> For the complete documentation index, see [llms.txt](https://alexisvisco.gitbook.io/kcd/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://alexisvisco.gitbook.io/kcd/hooks-and-extractors/string-extractor.md).

# String extractor

Extract values from \*http.Request or http.ResponseWriter

If you want to extract a value based on a tag name you can create your own string extractor.

You just need to implement[ this interface](https://github.com/alexisvisco/kcd/blob/master/pkg/extractor/extractors.go#L8):&#x20;

```go
type Strings interface {
	Extract(req *http.Request, res http.ResponseWriter, valueOfTag string) ([]string, error)
	
	Tag() string // the tag is for instance query, path or watever you want. 
	             // Then in your inputs structures you can use `watever:"something"`
}
```

Then before declaring your routes add your interface implementation to the list of StringsExtractors in the config.&#x20;

Like that:

```go
kcd.Config.StringsExtractors = append(kcd.Config.StringsExtractors, YourExtractor{})
```
