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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T22:43:26+00:00 2026-06-06T22:43:26+00:00

I have an example json as below: { Passwd:String content, Userme:String content } how

  • 0

I have an example json as below:

{
“Passwd”:”String content”,
“Userme”:”String content”
}

how to construct the JSON String as above and give it as argument to HttpPost in Android.?

Can anyone help me in sorting out this issue.

thanks in Advance,

  • 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-06T22:43:28+00:00Added an answer on June 6, 2026 at 10:43 pm

    You can make use of JSONObject to create a simple json like { "Passwd":"String content", "Userme":"String content" } try something like this.

                String json="";
                JSONObject jobj = new JSONObject();
                jobj.put("Userme", "Username");
                jobj.put("Passwd", "PasswordValue");
                json = jobj.toString();
    

    Above String can be sent as one of the parameter using HTTP POST easily. Below function takes url and json as parameters to make POST request.

    private void httpPost(String json,String url) throws ClientProtocolException, IOException{
          HttpClient httpClient = new DefaultHttpClient();
          HttpPost httpPost = new HttpPost(url);
          List<NameValuePair> nameValuePair = new ArrayList<NameValuePair>(2);
          nameValuePair.add(new BasicNameValuePair("json", json));
          httpPost.setEntity(new UrlEncodedFormEntity(nameValuePair));
          httpClient.execute(httpPost);
      }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have JSON Object that looks something like the below object, this object can
If I have JSON data stored in a string called 'data' (e.g. the example
May be you can help me with my task. I have a JSON string:
I'm a beginner with Json, I follow this tutorial the example I have written
For example lets say I have a JSON object that contains states and cities.
Example: I have the following JSON object. {currentVersion : 10.0, folders : [], services
Question: The JavaScript code below: records is JSON serialized data. I can access it
I am attempting to create a class in vb.net from the below JSON example.
I have the below Json (wf.json) { workflow:{ template:Analysis1, start:{ instance:HDA_run1, user:symtest, date:3-Mar-2012, timestamp:1330948220475
I have got below string values in a variable. var mystring = '{img_src:/english/images/spa.jpg, img_title:Enjoy

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.