HttpResponse.parseAs(..) should return null for HTTP Status "204 No Content" #135
Labels
priority: p2
Moderately-important priority. Fix may not be included in next release.
🚨
This issue needs some love.
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
From mlin...@google.com on June 27, 2012 13:08:53
When the deprecated HttpParsers are being used, and no content-type is specified, the .parseAs() method would fail with an IllegalArgumentException. In case an ObjectParser was specified, the underlying parser would also most likely fail with a similar exception.
However, the documentation of that method states that 'null' would be returned when no content was present. We should at least return null when we can be sure that there is no content (e.g. when the HttpStatusCode is '204 No Content') instead of throwing an exception.
Original issue: http://code.google.com/p/google-http-java-client/issues/detail?id=135
The text was updated successfully, but these errors were encountered: