Code example for StringEntity

0
		return null; 
	} 
 
    private void putUrl(String url, String data) throws Exception {
        HttpPut put = new HttpPut(url);
        put.setEntity(new StringEntity(data));
        HttpResponse response = executeRequest(put);
    } 
 
	protected HttpResponse executeRequest(HttpUriRequest request)
			throws ClientProtocolException, IOException { 
		DefaultHttpClient httpClient = new DefaultHttpClient();
		HttpResponse response = null;
		int retries = 3;
 
		while (retries-- > 0) {
			this.signRequest(request);
			response = httpClient.execute(request);
			int statusCode = response.getStatusLine().getStatusCode();
			if (statusCode == 400 || statusCode == 401) {
Stop searching for code, let great code find you!  Add Codota to your java IDE