@ Nonnull public CloseableHttpResponse execute ( @ Nonnull final HttpUriRequest aRequest , @ Nullable final HttpContext aHttpContext ) throws IOException { checkIfClosed ( ) ; HttpDebugger . beforeRequest ( aRequest , aHttpContext ) ; CloseableHttpResponse ret = null ; Throwable aCaughtException = null ; try { ret = m_aHttpClient . execute ( aRequest , aHttpContext ) ; return ret ; } catch ( final IOException ex ) { aCaughtException = ex ; throw ex ; } finally { HttpDebugger . afterRequest ( aRequest , ret , aCaughtException ) ; } }
Execute the provided request with an optional special context . Caller is responsible for consuming the response correctly!