Types
Multiple extractors can be specified in a request. As of now we support five type of extractors.- regex - Extract data from response based on a Regular Expression.
- kval - Extract
key: value/key=valueformatted data from Response Header/Cookie - json - Extract data from JSON based response in JQ like syntax.
- xpath - Extract xpath based data from HTML Response
- dsl - Extract data from the response based on a DSL expressions.
Regex Extractor
Example extractor for HTTP Response body using regex -Kval Extractor
A kval extractor example to extractcontent-type header from HTTP Response.
content-type has been replaced with content_type because kval extractor does not accept dash (-) as input and must be substituted with underscore (_).
JSON Extractor
A json extractor example to extract value ofid object from JSON block.
Xpath Extractor
A xpath extractor example to extract value ofhref attribute from HTML response.
DSL Extractor
A dsl extractor example to extract the effectivebody length through the len helper function from HTTP Response.
Dynamic Extractor
Extractors can be used to capture Dynamic Values on runtime while writing Multi-Request templates. CSRF Tokens, Session Headers, etc. can be extracted and used in requests. This feature is only available in RAW request format. Example of defining a dynamic extractor with nameapi which will capture a regex based pattern from the request.
internal: true to avoid printing extracted values in the terminal.
An optional regex match-group can also be specified for the regex for more complex matches.
csrf_token will hold the value extracted by ([[:alnum:]]{16}) as abcdefgh12345678.
If no group option is provided with this regex, the above extractor with name csrf_token will hold the full match (by <input name="csrf_token"\stype="hidden"\svalue="([[:alnum:]]{16})" />) as <input name="csrf_token" type="hidden" value="abcdefgh12345678" />.