Code example for HttpEntity

Methods: writeTo

0
        HttpResponse response = sendRequest(path, PARAM_GET, null, "");
 
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        try { 
            HttpEntity entity = response.getEntity();
            entity.writeTo(baos);
        } finally { 
			IOUtils.closeQuietly(baos);
        } 
		 
        return baos.toString();
    } 
	 
 
    public HttpResponse sendWPSRequest(String content) throws FileNotFoundException, IOException {
		return sendRequest("wps", PARAM_POST, PARAM_TEXT_XML, content);
	} 
	 
    HttpResponse sendRequest(String path, String requestMethod, String contentType, File content) throws FileNotFoundException, IOException {
        HttpPost post;
        HttpClient httpClient = new DefaultHttpClient();