Code example for BasicHeader

0
        try { 
            se = new StringEntity(params.toString());
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        } 
        se.setContentType(new BasicHeader(HTTP.CONTENT_TYPE, "application/json"));
 
        client.post(null, getAbsoluteUrl(url), se, "application/json", responseHandler);
    } 
 
    public void put(String url, RequestParams params, AsyncHttpResponseHandler responseHandler) {
        client.post(getAbsoluteUrl(url), params, responseHandler);
    } 
 
    public void put(String url, JSONObject params, AsyncHttpResponseHandler responseHandler) {
        StringEntity se = null;
        try { 
            se = new StringEntity(params.toString());
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }