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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T13:12:55+00:00 2026-05-24T13:12:55+00:00

For example if we need to send content which is in this format ,

  • 0

For example if we need to send content which is in this format , how do we do it
{“name1”:[{“name11″:”value11”},{“name11″:”value12”},{“name11″:”value13″}],”name2”:value2}

I know how to set the basic kind
{“name1″:”value1″,”name2”:value2}

NameValuePair[] nameValuePairs = new NameValuePair[2];   
            nameValuePairs[0]= new BasicNameValuePair("name1", "value1");
            nameValuePairs[1] = new BasicNameValuePair("name2", value2);

httpPost.setEntity(new UrlEncodedFormEntity(nameValuePairs));

How can we achieve nesting

  • 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-24T13:12:56+00:00Added an answer on May 24, 2026 at 1:12 pm

    Please see this question as it has a couple of answers that should help you. Here is a brief snippet from the answers code:

    HttpPost request = new HttpPost(serverUrl);
    request.setEntity(new ByteArrayEntity(
        postMessage.toString().getBytes("UTF8")));
    HttpResponse response = client.execute(request);
    

    The other answer says you can do something like this:

    protected void sendJson(final String email, final String pwd) {
    
                    HttpClient client = new DefaultHttpClient();
                    HttpConnectionParams.setConnectionTimeout(client.getParams(), 10000); //Timeout Limit
                    HttpResponse response;
                    JSONObject json = new JSONObject();
                    try{
                        HttpPost post = new HttpPost(URL);
                        json.put("email", email);
                        json.put("password", pwd);
                        StringEntity se = new StringEntity( "JSON: " + json.toString());  
                        se.setContentEncoding(new BasicHeader(HTTP.CONTENT_TYPE, "application/json"));
                        post.setEntity(se);
                        response = client.execute(post);
                        /*Checking response */
                        if(response!=null){
                            InputStream in = response.getEntity().getContent(); //Get the data in the entity
    
                    }
                    catch(Exception e){
                        e.printStackTrace();
                        createDialog("Error", "Cannot Estabilish Connection");
                    }
    
               }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Reinstating this question with a bounty! I need an example that stays online ,
I have this problem in my web page, I need to send a file
For example I need to disable two buttons in runtime. After I disabled first
For example I need to grab from http://gmail.com/ the number of free storage: Over
A specific example I need to generate a random number between 0 and 2,
I need an example algorithm that will draw pixels one at a time on
I need an example of the shortest path of a directed cyclic graph from
i need an example of the shortest path of directed graph cycle bye one
I need a basic example of how to use the IComparable interface so that
I need a detailed example about session in asp.net using c# For example

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.