-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
411 error on POST with empty body #838
Comments
Request semantics are defined such that the lack of a length header means the body is empty. For many servers, that's fine, and so the extra header doesn't need to be written. If you want to force the header, you could call |
I guess that's fine. I was surprised that a zero-length body is treated exactly the same as no body at all, though. |
Thanks, this worked for me. I started getting 411 responses from IIS after upgrading from reqwest 0.9.22 to reqwest 0.10.4. Changing from |
I just ran into an issue with this again. I checked RFC 9110 and found:
As such, I still think it would be an improvement to add this to relevant requests implicitly. |
I get a 411 Length Required error from Azure with "The request must be chunked or have a content length." when sending a POST request with a
.body("")
. In this case, since I am explicitly setting a body, I would expect thatContent-Length: 0
gets sent.The text was updated successfully, but these errors were encountered: