You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not immediately obvious to me that this was a deliberate design choice, or just the way things ended up being implemented. (We're passing auth in Client.send(), but we probably could very well move it onto a request.auth attribute.) As a matter of fact, we do support per-request auth, so… Maybe there's room for retro-fitting to the Requests API here?
Not immediately obvious to me that this was a deliberate design choice, or just the way things ended up being implemented. (We're passing auth in Client.send(), but we probably could very well move it onto a request.auth attribute.) As a matter of fact, we do support per-request auth, so… Maybe there's room for retro-fitting to the Requests API here?
I think we proabably want to keep things as they are. When I started out the "Requests Compatability" the intention was to document anything that differed across the Basic and Advanced usage guides, rather than that lower level bits of API would match all the way through.
It makes sense to me that our auth parameter would be on the send() method, since it's not something that we can always just call into to build some extra headers on the request method, it actually alters the sending flow.
I think we might be okay with a slightly general "Not all stuff in the lower level bits of API might match up exactly", giving a couple of examples? Or else perhaps a section for low level API differences, where we briefly list any notable cases. (Eg. I also haven't reviewed how our build_request/send compares to the requests equivelent.)
Agreed, I think it was only top-level compatibility (httpx.HTTP_VERB) that was shot for, and other things have come along naturally as they made sense to include.
Activity
[-]httpx.Request dosn't have the same [/-][+]httpx.Request don't take the same arguments[/+]florimondmanca commentedon Jan 28, 2020
Happy to review any PRs that document which parameters aren’t present on our
Requestclass compared to Requests. :)From what I can see these are:
files(I believe this is handled viadata, isn’t it?)hooksStephenBrown2 commentedon Jan 28, 2020
filesis there, butauthisn't.httpx/httpx/_models.py
Lines 591 to 604 in 82dc6f3
However,
authis available on therequestmethod:httpx/httpx/_api.py
Lines 18 to 34 in 82dc6f3
Hooks are discussed here: #790
florimondmanca commentedon Jan 28, 2020
Not immediately obvious to me that this was a deliberate design choice, or just the way things ended up being implemented. (We're passing
authinClient.send(), but we probably could very well move it onto arequest.authattribute.) As a matter of fact, we do support per-request auth, so… Maybe there's room for retro-fitting to the Requests API here?lovelydinosaur commentedon Jan 29, 2020
I think we proabably want to keep things as they are. When I started out the "Requests Compatability" the intention was to document anything that differed across the Basic and Advanced usage guides, rather than that lower level bits of API would match all the way through.
It makes sense to me that our
authparameter would be on thesend()method, since it's not something that we can always just call into to build some extra headers on the request method, it actually alters the sending flow.I think we might be okay with a slightly general "Not all stuff in the lower level bits of API might match up exactly", giving a couple of examples? Or else perhaps a section for low level API differences, where we briefly list any notable cases. (Eg. I also haven't reviewed how our
build_request/sendcompares to therequestsequivelent.)StephenBrown2 commentedon Jan 29, 2020
Agreed, I think it was only top-level compatibility (
httpx.HTTP_VERB) that was shot for, and other things have come along naturally as they made sense to include.Pradhvan commentedon Jun 14, 2020
@florimondmanca hey, you should close this PR as #823 is already been merged. 😄
florimondmanca commentedon Jun 14, 2020
Thanks for the heads up @Pradhvan!