-
With requests, we used |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Ah great question! Nope, we don't support that at the moment. Notes to the team for how we'd need to address this...
Other thoughts here...
Note that client/server addresses also came up briefly when discussing server-side usages... #1527 (comment) Looking at the ASGI spec is helpful here too... https://asgi.readthedocs.io/en/latest/specs/www.html#http-connection-scope Thinking about ensuring consistency with being able to provide this on either requests or responses impacts naming here. Having typed this through it seems to me that a good naming here would be |
Beta Was this translation helpful? Give feedback.
-
Message to future people looking for this feature. It's now support with import httpx
with httpx.Client() as client:
r = client.get("https://example.com")
print(r.extensions["network_stream"].get_extra_info("server_addr"))
print(r.extensions["network_stream"].get_extra_info("client_addr")) |
Beta Was this translation helpful? Give feedback.
Message to future people looking for this feature.
It's now support with
httpx>=0.21.0
or technicallyhttpcore>=0.14.0
. See request extensions.