Code example for StringEntity

Methods: setContentEncoding

0
  } 
*/ 
  private HttpResponse makePutRequest(URI uri, String data, Map<String,String> headers)
    throws IOException 
  { 
    StringEntity se = new StringEntity(data, HTTP.UTF_8);
    se.setContentEncoding("UTF-8");
    return makePutRequest(uri, se, headers);
  } 
 
  private HttpResponse makePutRequest(URI uri, HttpEntity entity, Map<String,String> headers)
    throws IOException 
  { 
    HttpPut request = new HttpPut(uri);
    request.setEntity(entity);
    return makeHttpRequest(request, headers);
  } 
 
  // COMMON REQUEST MAKER 
  private HttpResponse makeHttpRequest(
    HttpRequestBase request,