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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T22:31:34+00:00 2026-06-16T22:31:34+00:00

I am sending the the data to server, and trying to parse the json

  • 0

I am sending the the data to server, and trying to parse the json response which is of the form {"count":"2"}, but I am getting above exception

This is my code

post(serverUrl, params);

HttpClient httpClient = new DefaultHttpClient();
try{
    get = new HttpPost(url);
    r = httpClient.execute(get);
    he = r.getEntity();
    InputStream is = he.getContent();
    BufferedReader reader = new BufferedReader(new InputStreamReader(is, "UTF-8"), 8);
    StringBuilder sb = new StringBuilder();

    String line = null;
    while ((line = reader.readLine()) != null) { sb.append(line + "\n"); }

    String result = sb.toString();
    jObj = new JSONObject(result);
    Log.d(TAG, "Count is" + jObj);
    count = jObj.getString("count");
    Log.d(TAG, "Count is" + count);
}
catch (Exception e) { e.printStackTrace(); }
  • 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-16T22:31:35+00:00Added an answer on June 16, 2026 at 10:31 pm

    There is possibility for blank value in response. It cannot consider as null.. This error because of blank response.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was trying to parse response data from web server. I am using Xcode
I am having a weird problem with sending data back to my server. This
I'm trying to let a (android) client communicate with a server. Sending data client
I've been trying to send a JSON string to PHP server like this: $.ajax({
I have a form on a remote server I'm trying to submit data to,
This is what i'm trying to do and its pretty simple but i'm getting
I am trying to get some master data from server in JSON format and
How can I stop sending data to the server if the button allready has
I'm sending some data to an external URL using Curl. The server sends me
There are plenty of examples of sending data to SugarCRM via a web-service, but

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.