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

the value of request.ContentLength remains 0 on HTTP POST with body #253

Open
javidnia opened this issue Aug 23, 2022 · 1 comment
Open
Labels

Comments

@javidnia
Copy link

javidnia commented Aug 23, 2022

when sending an HTTP POST request, having bytes.NewReader(contentBytes) as body, the resulting net/http/request object has

ContnetLength=0

Library versions:
github.com/go-openapi/errors v0.20.2
github.com/go-openapi/runtime v0.24.1
github.com/go-openapi/strfmt v0.21.2

@javidnia javidnia changed the title the value of request.ContentLength remains 0 the value of request.ContentLength remains 0 on HTTP POST with body Aug 23, 2022
@casualjim
Copy link
Member

That's a streaming body that is sent with transfer encoding chunked probably. It can't know the content length of a stream unless you explicitly set it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants