artiya4u / google-http-java-client

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

Get parse HttpResponse content twice #192

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
See original request:
http://code.google.com/p/google-api-java-client/issues/detail?id=542

copied here:

Reported by jor...@uber.com, Jun 26, 2012
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 yan...@google.com on 14 Jan 2013 at 4:26

GoogleCodeExporter commented 9 years ago

Original comment by yan...@google.com on 24 Jan 2013 at 2:28

GoogleCodeExporter commented 9 years ago

Original comment by yan...@google.com on 6 Feb 2013 at 11:54

GoogleCodeExporter commented 9 years ago

Original comment by yan...@google.com on 10 Jun 2013 at 1:07

GoogleCodeExporter commented 9 years ago

Original comment by yan...@google.com on 26 Jul 2013 at 10:09