-
Notifications
You must be signed in to change notification settings - Fork 193
Problem sending JSON data as request body #206
Comments
@natemara Can you quickly test whether this problem is fixed by using the code from the |
I installed directly from master, and I'm getting the same results. |
Interesting. So this seems only to happen with nghttp2.org: with http2bin.org, the same problem is not observed. @tatsuhiro-t, do you have any theories about why nghttp2.org/httpbin might not be receiving data? |
The difference between working client (e.g., nghttp) and hyper client is that former sends content-length, but hyper does not. nghttpx (which forwards request to backend httpbin) uses Transfer-Encoding: chunked in HTTP/1, but httpbin seems to not support chunked request. I have not verified httpbin code yet. I just checked that request body without content-length was sent to backend using go HTTP server as nghttpx's backend. So probably, httpbin does not handle request body without content-length yet? |
@tatsuhiro-t That's interesting: what WSGI server are you using to run httpbin? |
Gunicorn. Does it answer your question? |
@tatsuhiro-t Hmm, that's interesting. http2bin.org uses H2O and gunicorn and doesn't display this problem. Weird. |
Will check how h2o behaves in this situation. I think it is possible to calculate content-length if all request body is buffered. |
@tatsuhiro-t Yeah, I think the lack of Content-Length in this case in hyper is a bug. That's ok. =) |
I checked what h2o does. As I guessed, h2o sets content-length if the request body fits in its buffer. |
Good intuition! =) |
I am trying to do some testing using the http2 version of httbin: https://nghttp2.org/httpbin/. Posting to the url
https://nghttp2.org/httpbin/post
will respond with a JSON object containing information about the request. This JSON includes the body and data sent with the request. Using hyper, it appears that the data that I'm sending as the request body is not being sent. Here's an example:Using a different http2 client, I get the expected response:
But using the python given above, I get the response:
I'm using version 0.5.0 of hyper, Python 3.4.4. Am I doing something wrong with my request, or is there a way to get more verbose output from hyper so that I can see what's really going on?
The text was updated successfully, but these errors were encountered: