You can retrieve the content from the entity only once. If you have
already extracted the content somewhere, and you try to fetch it
again, it will throw this IllegalStateException. Check you code and
make sure that you make this call only once.

- Kumar Bibek
http://tech-droid.blogspot.com

On Jul 23, 1:23 pm, tarun agarwal <tarun.2...@gmail.com> wrote:
> hi all,
>
> I'm making a http get request like this:
>
> try {
>    HttpClient client = new DefaultHttpClient();
>          String getURL =
> "http://busspur02.aseag.de/bs.exe?SID=5FC39&ScreenX=1440&ScreenY=900&C..."+day+"&DatumM="+month+"&DatumJ="+year+"&ZeitH="+hour+"&ZeitM="+min+"&Intervall=60&Suchen=(S)uchen&GT0=Aachen&T0=H&HT0="+start_from+"&GT1=Aachen&T0=H&HT1="+destination+"";
>          HttpGet get = new HttpGet(getURL);
>          HttpResponse responseGet = client.execute(get);
>          HttpEntity resEntityGet = responseGet.getEntity();
>          if (resEntityGet != null) {
>           //do something with the response
>              Log.i("GET RESPONSE",EntityUtils.toString(resEntityGet));
>              }
> ........
>
> ERROR:
> 04-30 14:01:01.287: WARN/System.err(1088): java.lang.IllegalStateException:
> Content has been consumed
> 04-30 14:01:01.297: WARN/System.err(1088):     at org.apache.http.entity.
> BasicHttpEntity.getContent(BasicHttpEntity.java:84)
> 04-30 14:01:01.297: WARN/System.err(1088):     at org.apache.http.conn.
> BasicManagedEntity.getContent(BasicManagedEntity.java:100)
> 04-30 14:01:01.307: WARN/System.err(1088):     at org.apache.http.util.
> EntityUtils.toString(EntityUtils.java:112)
> 04-30 14:01:01.307: WARN/System.err(1088):     at org.apache.http.util.
> EntityUtils.toString(EntityUtils.java:146)
> 04-30 14:01:01.307: WARN/System.err(1

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to