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 7848801
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T18:20:08+00:00 2026-06-02T18:20:08+00:00

i am firing a HTTP post request post request from a AsyncTask in android

  • 0

i am firing a HTTP post request post request from a AsyncTask in android to the server.

the problem i am facing in managing the response. here how i read the response.

HttpEntity entity =response.getEntity();
if (entity != null) {

    DataInputStream in = new DataInputStream( entity.getContent());
    String str;
    while (( str = in.readLine()) != null){


    Log.e("Debug","Server Response second url"+str); 

 }
   in.close();
}

the issue is i am getting the response in pieces , but i wanted them in a one piece

Current Response

 Server Response second url
 Server Response second url<header><status>Success</status><message>Check the Numbers:
 Server Response second url123456.</message><vbal>5005</vbal></header>

Expected Response

<header><status>Success</status><message>Check the Numbers:123456.</message><vbal>5005</vbal></header>

if i will get it in a one piece i can parse the xml response easily and fetch the required value.

  • 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-06-02T18:20:10+00:00Added an answer on June 2, 2026 at 6:20 pm

    This should work for you:

    StringBuilder sb = new StringBuilder();
    String str;
    while ((str = in.readLine()) != null) {
        sb.append(str);
    }
    in.close();
    str = sb.toString(); //here you have the string you need.
    Log.e("Debug","Server Response second url" + str); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the overlay jquery from here: http://flowplayer.org/tools/overlay/index.html Within my overlay I have a
I am firing a request through my android application using HttpPost , as the
Bit of a JavaScript newbie here - I am firing this basic bit of
I am firing a GET request with Greasemonkey's GM_xmlhttpRequest() : $(.getReview).click(function(){ var videoId =
EDIT: Here's a link to show you my sample code: http://www.singingeels.com/jqtest/ I have a
I am confused as to why an alert is not firing a json response.
Well, this is my first post here and really enjoying the site. I have
My javascript button is not firing. <!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd>
error not firing. but its showing on firebug HTTP 500 error : jQuery15105771912402844872_1324698623378({Message:Master Order
I'm firing off a Java application from inside of a C# .NET console application.

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.