Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 762165
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T15:55:30+00:00 2026-05-14T15:55:30+00:00

I’m making a http get request like this: try { HttpClient client = new

  • 0

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&CMD=CR&Karten=true&DatumT="+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));
    } 
    ...
} catch (...) {
    ...
}

It all works well… the only problem: the output from Log.i is cut-off… It’s not the complete html page. If I make the same request in a browser, I get 3x the output in opposition to making the request in the emulator and using the above code…. what’s wrong?

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(1088):     at mjb.project.AVV.ParseHTML.start(ParseHTML.java:177)
04-30 14:01:01.307: WARN/System.err(1088):     at mjb.project.AVV.ParseHTML.onCreate(ParseHTML.java:139)
04-30 14:01:01.307: WARN/System.err(1088):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
04-30 14:01:01.327: WARN/System.err(1088):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)
04-30 14:01:01.327: WARN/System.err(1088):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
04-30 14:01:01.327: WARN/System.err(1088):     at android.app.ActivityThread.access$2200(ActivityThread.java:119)
04-30 14:01:01.347: WARN/System.err(1088):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
04-30 14:01:01.347: WARN/System.err(1088):     at android.os.Handler.dispatchMessage(Handler.java:99)
04-30 14:01:01.347: WARN/System.err(1088):     at android.os.Looper.loop(Looper.java:123)
04-30 14:01:01.347: WARN/System.err(1088):     at android.app.ActivityThread.main(ActivityThread.java:4363)
04-30 14:01:01.347: WARN/System.err(1088):     at java.lang.reflect.Method.invokeNative(Native Method)
04-30 14:01:01.357: WARN/System.err(1088):     at java.lang.reflect.Method.invoke(Method.java:521)
04-30 14:01:01.357: WARN/System.err(1088):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
04-30 14:01:01.357: WARN/System.err(1088):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
04-30 14:01:01.357: WARN/System.err(1088):     at dalvik.system.NativeStart.main(Native Method)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T15:55:30+00:00Added an answer on May 14, 2026 at 3:55 pm

    OK I solved it.
    As I understand, the content of the entity gets consumed if it’s not “used”. So I created a new String object with the content of the Entity, so to say a copy instead of a reference to the entity’s content.

    try {
        HttpClient client = new DefaultHttpClient();  
        String getURL = "http://busspur02.aseag.de/bs.exe?SID=5FC39&ScreenX=1440&ScreenY=900&CMD=CR&DatumT="+day+"&DatumM="+month+"&DatumJ="+year+"&ZeitH="+hour+"&ZeitM="+min+"&Intervall=120&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();  
        String sourceString = "";
    
        if (resEntityGet != null) {                 
            try {
                dismissDialog();
                sourceString= new String(EntityUtils.toString(resEntityGet));
                Log.i("GET RESPONSE", sourceString);
            } catch (ParseException exc) {
                // TODO Auto-generated catch block
                exc.printStackTrace();
            } catch (IllegalStateException exc) {
                // TODO Auto-generated catch block
                exc.printStackTrace();
            }
            ...
        }
        ...
    } catch(...) {
    ...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 367k
  • Answers 367k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The call to getLastKnownLocation() doesn't block - which means it… May 14, 2026 at 4:53 pm
  • Editorial Team
    Editorial Team added an answer To use a file from a remote server, use imagecreatefromstring… May 14, 2026 at 4:53 pm
  • Editorial Team
    Editorial Team added an answer First, consider using using, second, let the framework handle disposal.… May 14, 2026 at 4:53 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.