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

Documentation is clearer about using same connection for multiple requests via 'request' function #282

Merged
merged 1 commit into from
Dec 15, 2022

Conversation

alexdowad
Copy link
Contributor

If a previous HTTP response had a response body, and the body was never read, then a subsequent call to request using the same connection will fail. This is because the unread response body will still be sitting in the TCP socket buffers. As a result, when the subsequent call to request tries to read the first line of its response to parse out the HTTP version and status code, it will get the first line of the unread response body instead, which will almost certainly not be a valid HTTP status code line.

The documentation was not at all clear about this; make it explicitly state what the user needs to do.

…uests via 'request' function

If a previous HTTP response had a response body, and the body was never
read, then a subsequent call to 'request' using the same connection will
fail. This is because the unread response body will still be sitting in
the TCP socket buffers. As a result, when the subsequent call to
'request' tries to read the first line of its response to parse out the
HTTP version and status code, it will get the first line of the unread
response body instead, which will almost certainly not be a valid
HTTP status code line.

The documentation was not at all clear about this; make it explicitly
state what the user needs to do.
@pintsized pintsized merged commit b2806bd into ledgetech:master Dec 15, 2022
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

Successfully merging this pull request may close these issues.

None yet

2 participants