title: Java android AsyncHttpClient how set header 'Accept' an 'application / xml' or 'application / json'
body: <p>I don't know how I can set a header "Accept" for 'applicatjon/json now my response from server is a xml but I want to have a json. A server should send me a xml when I set a header. This is my code :</p>
  
  <pre><code>  final JSONObject requestObject = new JSONObject();
          try {
              requestObject.put("company", "TEST");
              requestObject.put("user", "pawelo");
              requestObject.put("secure_password", "8ce241e1ed84937ee48322b170b9b18c");
              requestObject.put("secure_device_id", "C4CA4238A0B923820DCC509A6F75849B");
          } catch (JSONException e) {
              e.printStackTrace();
          }
  
  
          StringEntity entity = null;
          try {
              entity = new StringEntity(requestObject.toString());
          } catch (UnsupportedEncodingException e) {
              e.printStackTrace();
          }
          entity.setContentType(new BasicHeader(HTTP.CONTENT_TYPE, "application/json"));
  client.post(this, url, entity, "application/json",
              new  BaseJsonHttpResponseHandler("UTF-8") {
  
                  @Override
                  public void onSuccess(int statusCode, Header[] headers, String rawJsonResponse, Object response) {
                      Log.e("sdasa " , rawJsonResponse + " " + statusCode);
                  }
  
                  @Override
                  public void onFailure(int statusCode, Header[] headers, Throwable throwable, String rawJsonData, Object errorResponse) {
  
                  }
  
                  @Override
                  protected Object parseResponse(String rawJsonData, boolean isFailure) throws Throwable {
                      return null;
                  }
              });
  </code></pre>