artiya4u / google-http-java-client

Automatically exported from code.google.com/p/google-http-java-client
0 stars 0 forks source link

HttpResponse.parseAs(..) should return null for HTTP Status "204 No Content" #135

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
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 reported on code.google.com by mlin...@google.com on 27 Jun 2012 at 8:08

GoogleCodeExporter commented 9 years ago

Original comment by mlin...@google.com on 9 Jul 2012 at 10:16