Code example for HttpPut

Methods: setEntitysetHeadersetHeaders

0
		// post.setHeader("Content-type", "image/jpeg"); 
		return execute(post, coding);
	} 
 
	public static String sendPutRequest(String url, String coding, String json, Header[] headers) throws ApplicationException {
		HttpPut put = new HttpPut(url);
		StringEntity se;
		try { 
			se = new StringEntity(json);
			se.setContentType(new BasicHeader(HTTP.CONTENT_TYPE, "application/json"));
			put.setHeaders(headers);
			put.setEntity(se);
			put.setHeader("Content-type", "application/json");
 
		} catch (UnsupportedEncodingException e) {
			throw new ApplicationException(e);
			// e.printStackTrace(); 
		} 
		return execute(put, coding);
	} 
Contextual code suggestions in your IDE  Get Codota for Java