Phoenixasuga / google-api-java-client

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

Get parse HttpResponse content twice #542

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Version of google-api-java-client (e.g. 1.5.0-beta)?
ALL

Java environment (e.g. Java 6, Android 2.3, App Engine)?
Android

When using parseAsString on HttpResponse, it consumes the InputStream. It is 
then unusable with the parseAs method. I want to be able to get a string for my 
own logs (and I don't want to use the provided HttpTransport.LOGGER) and then 
be able to parseAs().

How would you expect it to be fixed?

HttpResponse could have a method writeTo(OutputStream os) so that we can get 
the content. This method would have to make sure the stream can be re-read.

Original issue reported on code.google.com by jor...@uber.com on 26 Jun 2012 at 6:05

GoogleCodeExporter commented 9 years ago

Original comment by rmis...@google.com on 14 Jan 2013 at 3:31

GoogleCodeExporter commented 9 years ago
Moved to:
http://code.google.com/p/google-http-java-client/issues/detail?id=192

Original comment by yan...@google.com on 14 Jan 2013 at 4:27