-
Notifications
You must be signed in to change notification settings - Fork 38
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
Bug: http post with body #3
Comments
Same here, I forked and fixed it here. |
I met the same problem |
It is 2023 and this problem has not been solved yet. Is there any substitute? |
ahonggea
added a commit
to ahonggea/digest
that referenced
this issue
Jan 5, 2023
The https://github.com/mongodb-forks/digest fork doesn't have this problem. I've been using it for a couple of years. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There is a bug with this library. If you use the wrapper to send http post with body (eg. json) you will get a "ContentLeng=... with Body length is 0" error. The reason being "body" in http.request object is io.reader, it is being read once when doing authentication and is depleted. When the actual request is sent to server after authenticated, the buffer is already drained and is empty, thus the length 0 error. I find this post particular useful , it fixes the bug:
https://stackoverflow.com/questions/23070876/reading-body-of-http-request-without-modifying-request-state
The text was updated successfully, but these errors were encountered: