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
Exception on http status code 204 #13134
Comments
What's the Crystal error? |
Seems the behaviour is quite diverse: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/204#compatibility_notes
and quite annoying MS is making basic mistakes with their APIs |
Does the response in your case include a Without a |
All the browsers take the approach of ignoring the body data and making it unavailable to the user. Given it's a success response it might make sense to follow Apples lead and just close the connection if any body data is provided - as the crystal client doesn't pipeline requests, there is no need to search for the next response. If the crystal client treats responses, where no body is expected, with a body as valid, closes the connection and returns the headers, I think that would be improved behaviour. |
Closing the connection definitely sounds like the easiest basic solution here. We can always improve it later with fancier stuff, if necessary. |
We're seeing an error on a 204 response from Microsoft. As you can see, MS Graph API returns an empty object as a response body on a 204 (image below)
Not sure what the HTTP standard says about 204 responses, however it seems a little heavy handed to raise an error in this case.
The application using the HTTP client can happily ignore the body if any was sent.
related to #2512
The text was updated successfully, but these errors were encountered: