title: How to use parameters with HttpPost
body: <p>I am using a RESTfull webservice with this methode:</p>
  
  <pre><code>@POST
  @Consumes({"application/json"})
  @Path("create/")
  public void create(String str1, String str2){
  System.out.println("value 1 = " + str1);
  System.out.println("value 2 = " + str2);
  }
  </code></pre>
  
  <p>In my Android app I want to call this method. How do I give the correct values to the parameters using org.apache.http.client.methods.HttpPost;</p>
  
  <p>I have noticed that I can use the annotation @HeaderParam and simply add headers to the HttpPost object. Is this the correct way? Doing it like:</p>
  
  <pre><code>httpPost.setHeader("Accept", "application/json");
  httpPost.setHeader("str1", "a value");
  httpPost.setHeader("str2", "another value");
  </code></pre>
  
  <p>Using the setEntity methode on httpPost won't work. It only sets the parameter str1 with the json string. When using it like:</p>
  
  <pre><code>JSONObject json = new JSONObject();
  json.put("str1", "a value");
  json.put("str2", "another value");
  HttpEntity e = new StringEntity(json.toString());
  httpPost.setEntity(e);
  //server output: value 1 = {"str1":"a value","str2":"another value"} 
  </code></pre>