-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow for tracing headers sent on the wire by the client #5105
Labels
Comments
Agree, a new tracing signal sounds reasonable. |
Fixed by #5122 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
🐣 Is your feature request related to a problem? Please describe.
Feature request:
TraceConfig
does not allow for tracing "headers sent" stage, while it is quite often useful to verify them on-the-wire.💡 Describe the solution you'd like
Implement on_headers_sent signal which provides exact on-the wire headers buffer sent, similar to on_request_chunk_sent.
The implementation should be quite straightforward:
TraceConfig
on_headers_sent
toStreamWriter
constructor, similar likeon_chunk_sent
is providedbuf
.❓ Describe alternatives you've considered
Workaround to see on-the-wire headers seems to be possible only with
unittest.patch
, or with monkey-copying wholeClientRequest.send
lenghty function into a child class, adding logging there and providing this class toClientSession
.Here is a sample workaround with patching:
📋 Additional context
When performing some API calls to remote server requiring very specific or complicated headers, it is useful to compare exact headers sent to e.g. what is sent through postman or browser. Not having access to textual representation of headers make this tedious. Also such a feature would allow for validating if cookie headers are correctly set by
aiohttp.ClientSession
.The text was updated successfully, but these errors were encountered: