-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
The size_hint
in HttpBody
can change behavior when making GET requests with bodies
#2444
Comments
Hmmm, so you have a custom type implementing |
I have a custom type that, depending on the situation, may return the default size hint (unbounded), or else an exact size. My surprise was that for a GET request, the size hint affected whether the body was sent at all. I would expect that if Hyper drops the body when making GET requests, it would so so in all cases, regardless of the size hint for the body. |
I see, I'm starting to remember now. So, while very rare, it's legal to send a body with a GET. So hyper settled on these rules, currently:
|
Roger that! Thanks for the clarification. If this is intended behavior, I wonder if it could be added to documentation, in case others trip over the same issue. |
I think this is subtly related to #2427 |
This is a subtle one! Bodies for GET requests are ignored, unless the
HttpBody::size_hint
provides an exact size, in which case they are transmitted. Thesize_hint
should not affect behavior in this way, AIUI.I was using the general
Client::request
API to pass through a request that happened to be aGET
with a body.The text was updated successfully, but these errors were encountered: