Code example for HttpPost

Methods: setEntityabort

0
		} 
	} 
 
	protected void postMethod(StreamData data, String url, MultipartEntity entity) throws ArtAroundException {
		final AndroidHttpClient client = getNewHttpClient();
		final HttpPost postRequest = new HttpPost(url);
 
		//postRequest.setHeader("Accept", "application/json"); 
		//postRequest.setHeader("Content-Type", "image/jpeg"); 
		postRequest.setEntity(entity);
 
		try { 
			HttpResponse response = client.execute(postRequest);
			parseHttpResponse(data, url, response);
		} 
		catch (IOException e) {
			throw new ArtAroundException(e);
		} 
		finally { 
			if (postRequest != null) {
				postRequest.abort();
			} 
			if (client != null) {
				client.close();
			} 
		} 
Experience pair programming with AI  Get Codota for Java