-
Notifications
You must be signed in to change notification settings - Fork 176
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
No automatic chunked Transfer Encoding when using Request.send #43
Comments
You're right! It could be good to set this header if we haven't set a content-length already. At this point it would be a (subtle) breaking change, so not entirely how to handle it. Maybe submit a PR and we do it when we bump to 0.13.0? I'm not rewriting |
Alright, thank you for your answer! I'll submit a PR when I have some time: I have a pretty good idea where to do the edit. |
Here's the relevant section of RFC 7230:
So I think tiny_http is right to ignore message bodies if neither Content-Length nor Transfer-Encoding is provided. Right now there are two ways to provide a message body in ureq: That would probably be okay, since the HTTP spec makes it mandatory to support chunked encoding:
But that's definitely worth documenting. And if it turns out in the future that this causes compatibility problems, ureq could add a |
Oops, I see that there already is a Based on that updated understanding, I agree it makes sense to set Transfer-Encoding: chunked for the user when |
I believe this is working now. |
On
ureq
version0.12.0
:When using the
Request.send
method, no headers are set to indicate some body content to the server. It causes some servers to completely ignore the body (liketiny_http
).The
Request.send
method should automatically enable thechunked
encoding.A workaround for this issue is to set the Transfer-Encoding header prior sending the request to enable the
chunked
transfer:I am doing this issue more as a warning for people like me that will stumble upon this gotcha. I have noticed that you are actually working a brand new version on
ureq
that probably fixed that issue already so it's maybe not a good idea to spend time fixing this issue. Maybe it should just be mentioned in the documentation ofRequest.send
that the user may want to set thechunked
transfer.The text was updated successfully, but these errors were encountered: