Skip to content
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

Open
MaxBear opened this issue Feb 1, 2018 · 4 comments
Open

Bug: http post with body #3

MaxBear opened this issue Feb 1, 2018 · 4 comments

Comments

@MaxBear
Copy link

MaxBear commented Feb 1, 2018

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

@SoftwareMensch
Copy link

Same here, I forked and fixed it here.

@skytodmoon
Copy link

I met the same problem

@ahonggea
Copy link

ahonggea commented Jan 5, 2023

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
@magnusbaeck
Copy link

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants