public Response execute ( String httpUrl , String methodName , Map < String , Object > headers , Map < String , Object > queryParams , Object body ) throws Exception { httpclient = createHttpClient ( ) ; // --------------------------- // Handle request body content // --------------------------- String reqBodyAsString = handleRequestBody ( body ) ; // ----------------------------------- // Handle the url and query parameters // ----------------------------------- httpUrl = handleUrlAndQueryParams ( httpUrl , queryParams ) ; RequestBuilder requestBuilder = createRequestBuilder ( httpUrl , methodName , headers , reqBodyAsString ) ; // ------------------ // Handle the headers // ------------------ handleHeaders ( headers , requestBuilder ) ; // ------------------ // Handle cookies // ------------------ addCookieToHeader ( requestBuilder ) ; CloseableHttpResponse httpResponse = httpclient . execute ( requestBuilder . build ( ) ) ; // -------------------- // Handle the response // -------------------- return handleResponse ( httpResponse ) ; }
Override this method in case you want to execute the http call differently via your http client . Otherwise the framework falls back to this implementation by default .