public void sendRequest() { if (requestBuilderPartCurr != null) { try { requestBuilderPartCurr.processContents(); } catch (Exception e) { displayExceptionError(e); return; } } HttpUriRequest uriRequest; try { uriRequest = requestBuilder.buildRequest(); } catch (Exception e) { displayExceptionError(e); return; } BasicHttpContext ctx = new BasicHttpContext(); IHttpResponse response; try { response = requestEngine.sendRequest(uriRequest, ctx); responseViewer.displayHttpResponse(response.getRawResponse()); } catch (Exception e) { displayExceptionError(e); return; } if (contentAnalyzer != null) { contentAnalyzer.processResponse(response); } if (requestBuilderPartCurr != null) { requestBuilderPartCurr.refresh(); } }
public RequestEditView() { super(); if (requestEngine == null) { IHttpRequestEngineFactory requestEngineFactory = Activator.getDefault().getHttpRequestEngineFactoryService(); final HttpClient httpClient = requestEngineFactory.createBasicClient(); requestEngine = requestEngineFactory.createRequestEngine(httpClient, requestEngineFactory.createConfig()); } requestBuilder = requestEngine.createRequestBuilder(); }