title: Transfer JSON to server in post request
body: <p>Server takes two parameters: <code>String</code> and <code>JSON</code>.
  Prompt, correctly I transfer <code>JSON</code> and String in POST request?</p>
  
  <pre><code>try {
      HttpClient httpClient = new DefaultHttpClient();
      HttpPost httpPost = new HttpPost("my_url");
      List parameters = new ArrayList(2);
      JSONObject jsonObject = new JSONObject();
      jsonObject.put("par_1", "1");
      jsonObject.put("par_2", "2");
      jsonObject.put("par_3", "3");
      parameters.add(new BasicNameValuePair("action", "par_action"));
      parameters.add(new BasicNameValuePair("data", jsonObject.toString()));
      httpPost.setEntity(new UrlEncodedFormEntity(parameters));
      HttpResponse httpResponse = httpClient.execute(httpPost);
      Log.v("Server Application", EntityUtils.toString(httpResponse.getEntity())+" "+jsonObject.toString());
  
  } catch (UnsupportedEncodingException e) {
      Log.e("Server Application", "Error: " + e);
  } catch (ClientProtocolException e) {
      Log.e("Server Application", "Error: " + e);
  } catch (IOException e) {
      Log.e("Server Application", "Error: " + e);
  } catch (JSONException e) {
      e.printStackTrace();
  }
  </code></pre>