LOG.debug( "Performing GET request: " + query ); HttpResponse httpResponse = httpClient.execute( httpGet ); response = new OwsHttpResponseImpl( httpResponse, httpClient.getConnectionManager(), sb.toString() ); } catch ( Throwable e ) { e.printStackTrace();
@Override public OwsHttpResponse doPost( URL endPoint, String contentType, StreamBufferStore body, Map<String, String> headers ) throws IOException { OwsHttpResponse response = null; try { HttpPost httpPost = new HttpPost( endPoint.toURI() ); DefaultHttpClient httpClient = getInitializedHttpClient( endPoint ); LOG.debug( "Performing POST request on " + endPoint ); LOG.debug( "post size: " + body.size() ); InputStreamEntity entity = new InputStreamEntity( body.getInputStream(), (long) body.size() ); entity.setContentType( contentType ); httpPost.setEntity( entity ); HttpResponse httpResponse = httpClient.execute( httpPost ); response = new OwsHttpResponseImpl( httpResponse, httpClient.getConnectionManager(), endPoint.toString() ); } catch ( Throwable e ) { String msg = "Error performing POST request on '" + endPoint + "': " + e.getMessage(); throw new IOException( msg ); } return response; }