title: HttpGet with request body android
body: <p>I try to make a request on server by HttpGet. But in message body should be a json object. Code below is not working because unit_id and sercret_key are not sent on server in body message. How can I do it?</p>
  
  <p>JSONObject:</p>
  
  <pre><code>{
  "unit_id": 12345,
  "secret_key": "sdfadfsa6as987654754"
  }
  </code></pre>
  
  <p>My code:</p>
  
  <pre><code>private HttpResponse makeRequest(int id, String secretKey) throws Exception {
      BasicHttpParams params = new BasicHttpParams();
      params.setParameter("id", id);
  
      params.setParameter("secret_key", secretKey);
  
      httpget.setHeader("Accept", "application/json");
  
      httpget.setParams(params);
      httpget.setHeader("Content-type", "application/json");
  
      // Handles what is returned from the page
      return httpclient.execute(httpget);
  }
  </code></pre>
  
  <p><strong>Edit:</strong> in php this request is made like this</p>
  
  <pre><code>&lt;?php
  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, "http://0101.apiary.io/api/reservations/");
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
  curl_setopt($ch, CURLOPT_HEADER, FALSE);
  curl_setopt($ch, CURLOPT_POSTFIELDS, "{\n    \"unit_id\": 12345,\n    \"secret_key\":     \"sdfadfsa6as987654754\"\n}");
  curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json"));
  $response = curl_exec($ch);
  curl_close($ch);
  
  var_dump($response);
  </code></pre>