httpx
httpx copied to clipboard
Extend the scope matchers and extractors to include response headers
Please describe your feature request:
Currently, matchers/extractors are limited to a response body that can be extended to include response headers as well.
Describe the use case of this feature:
In an effort to extract authentication methods in bulk, I frequently collect headers and parse out the www-authenticate header. It would be great if this extracted type (basic, digest Bearer) and any additional info (realm etc).
Currently extractors only work on the response body. We could easily extend this to also consider the response headers (or even the same for requests).
Other options:
- add a dedicated flag that would control the scope for matchers and extractors
- create separate flags for request headers, request body and response headers
This request should potentially affect or would require extension of the following flags:
- [x]
-match-string
- [x]
-match-regex
- [x]
-extract-regex
- [x]
-extract-preset
Documentation has to created/updated.
The linked PR might not handle all the cases mentioned in this ticket.