Refine search
@Override protected BasicHttpProcessor createHttpProcessor() { BasicHttpProcessor httpproc = new BasicHttpProcessor(); httpproc.addInterceptor(new RequestDefaultHeaders()); // Required protocol interceptors httpproc.addInterceptor(new RequestContent()); httpproc.addInterceptor(new RequestTargetHost()); // Recommended protocol interceptors httpproc.addInterceptor(new RequestConnControl()); httpproc.addInterceptor(new RequestUserAgent()); httpproc.addInterceptor(new RequestExpectContinue()); // HTTP state management interceptors httpproc.addInterceptor(new RequestAddCookies()); httpproc.addInterceptor(new ResponseProcessCookies()); // HTTP authentication interceptors httpproc.addInterceptor(new RequestTargetAuthentication()); httpproc.addInterceptor(new RequestProxyAuthentication()); return httpproc; }
public static CloseableHttpClient create(RequestConfig config, HttpRequestRetryHandler retryHandler, HttpClientConnectionManager connectionManager) { HttpClientBuilder builder = HttpClientBuilder.create(); builder.useSystemProperties().setRedirectStrategy(AlwaysRedirectStrategy.DEFAULT).addInterceptorLast(new RequestContent(true)); if (config != null) builder.setDefaultRequestConfig(config); if (retryHandler != null) builder.setRetryHandler(retryHandler); if (connectionManager != null) builder.setConnectionManager(connectionManager); return builder.build(); }
static CloseableHttpClient create(RequestConfig config, HttpRequestRetryHandler retryHandler, HttpClientConnectionManager connectionManager) { HttpClientBuilder builder = HttpClientBuilder.create(); builder.useSystemProperties().setRedirectStrategy(AlwaysRedirectStrategy.DEFAULT) .addInterceptorLast(new RequestContent(true)); if (config != null) builder.setDefaultRequestConfig(config); if (retryHandler != null) builder.setRetryHandler(retryHandler); if (connectionManager != null) builder.setConnectionManager(connectionManager); return builder.build(); }
t.start(); HttpProcessor httpProcessor = new ImmutableHttpProcessor(new RequestContent(), new RequestTargetHost(), new RequestConnControl(), new RequestUserAgent(), new RequestExpectContinue(false)); requester = new HttpAsyncRequester(httpProcessor, new DefaultConnectionReuseStrategy());
/** * Override just to set RequestContent(true) */ @Override protected BasicHttpProcessor createHttpProcessor() { final BasicHttpProcessor parentHttpProcessor = super.createHttpProcessor(); for (int i = 0; i < parentHttpProcessor.getRequestInterceptorCount(); i++) { final HttpRequestInterceptor requestInterceptor = parentHttpProcessor.getRequestInterceptor(i); //Replace the existing RequestContent interceptor with a version that sets overwrite=true if (requestInterceptor instanceof RequestContent) { parentHttpProcessor.removeRequestInterceptorByClass(RequestContent.class); parentHttpProcessor.addInterceptor(new RequestContent(true), i); break; } } return parentHttpProcessor; } }
public MinimalClientExec( final HttpRequestExecutor requestExecutor, final HttpClientConnectionManager connManager, final ConnectionReuseStrategy reuseStrategy, final ConnectionKeepAliveStrategy keepAliveStrategy) { Args.notNull(requestExecutor, "HTTP request executor"); Args.notNull(connManager, "Client connection manager"); Args.notNull(reuseStrategy, "Connection reuse strategy"); Args.notNull(keepAliveStrategy, "Connection keep alive strategy"); this.httpProcessor = new ImmutableHttpProcessor( new RequestContent(), new RequestTargetHost(), new RequestClientConnControl(), new RequestUserAgent(VersionInfo.getUserAgent( "Apache-HttpClient", "org.apache.http.client", getClass()))); this.requestExecutor = requestExecutor; this.connManager = connManager; this.reuseStrategy = reuseStrategy; this.keepAliveStrategy = keepAliveStrategy; }
static CloseableHttpAsyncClient create(RequestConfig config, NHttpClientConnectionManager connectionManager) { HttpAsyncClientBuilder builder = HttpAsyncClientBuilder.create(); builder.useSystemProperties().setRedirectStrategy(AlwaysRedirectStrategy.DEFAULT) .addInterceptorLast(new RequestContent(true)); if (config != null) builder.setDefaultRequestConfig(config); if (connectionManager != null) builder.setConnectionManager(connectionManager); return builder.build(); }
.addAll(new RequestContent(), new RequestTargetHost(), new RequestConnControl(), new RequestUserAgent("HTTP/1.1"))
public static CloseableHttpAsyncClient create(RequestConfig config, NHttpClientConnectionManager connectionManager) { HttpAsyncClientBuilder builder = HttpAsyncClientBuilder.create(); builder.useSystemProperties().setRedirectStrategy(AlwaysRedirectStrategy.DEFAULT).addInterceptorLast(new RequestContent(true)); if (config != null) builder.setDefaultRequestConfig(config); if (connectionManager != null) builder.setConnectionManager(connectionManager); return builder.build(); }
public MinimalClientExec( final HttpRequestExecutor requestExecutor, final HttpClientConnectionManager connManager, final ConnectionReuseStrategy reuseStrategy, final ConnectionKeepAliveStrategy keepAliveStrategy) { Args.notNull(requestExecutor, "HTTP request executor"); Args.notNull(connManager, "Client connection manager"); Args.notNull(reuseStrategy, "Connection reuse strategy"); Args.notNull(keepAliveStrategy, "Connection keep alive strategy"); this.httpProcessor = new ImmutableHttpProcessor( new RequestContent(), new RequestTargetHost(), new RequestClientConnControl(), new RequestUserAgent(VersionInfo.getUserAgent( "Apache-HttpClient", "org.apache.http.client", getClass()))); this.requestExecutor = requestExecutor; this.connManager = connManager; this.reuseStrategy = reuseStrategy; this.keepAliveStrategy = keepAliveStrategy; }
public MinimalClientExec( final HttpRequestExecutor requestExecutor, final HttpClientConnectionManager connManager, final ConnectionReuseStrategy reuseStrategy, final ConnectionKeepAliveStrategy keepAliveStrategy) { Args.notNull(requestExecutor, "HTTP request executor"); Args.notNull(connManager, "Client connection manager"); Args.notNull(reuseStrategy, "Connection reuse strategy"); Args.notNull(keepAliveStrategy, "Connection keep alive strategy"); this.httpProcessor = new ImmutableHttpProcessor( new RequestContent(), new RequestTargetHost(), new RequestClientConnControl(), new RequestUserAgent(VersionInfo.getUserAgent( "Apache-HttpClient", "org.apache.http.client", getClass()))); this.requestExecutor = requestExecutor; this.connManager = connManager; this.reuseStrategy = reuseStrategy; this.keepAliveStrategy = keepAliveStrategy; }
public MinimalClientExec( final HttpRequestExecutor requestExecutor, final HttpClientConnectionManager connManager, final ConnectionReuseStrategy reuseStrategy, final ConnectionKeepAliveStrategy keepAliveStrategy) { Args.notNull(requestExecutor, "HTTP request executor"); Args.notNull(connManager, "Client connection manager"); Args.notNull(reuseStrategy, "Connection reuse strategy"); Args.notNull(keepAliveStrategy, "Connection keep alive strategy"); this.httpProcessor = new ImmutableHttpProcessor( new RequestContent(), new RequestTargetHost(), new RequestClientConnControl(), new RequestUserAgent(VersionInfo.getUserAgent( "Apache-HttpClient", "org.apache.http.client", getClass()))); this.requestExecutor = requestExecutor; this.connManager = connManager; this.reuseStrategy = reuseStrategy; this.keepAliveStrategy = keepAliveStrategy; }
public MinimalClientExec( final HttpRequestExecutor requestExecutor, final HttpClientConnectionManager connManager, final ConnectionReuseStrategy reuseStrategy, final ConnectionKeepAliveStrategy keepAliveStrategy) { Args.notNull(requestExecutor, "HTTP request executor"); Args.notNull(connManager, "Client connection manager"); Args.notNull(reuseStrategy, "Connection reuse strategy"); Args.notNull(keepAliveStrategy, "Connection keep alive strategy"); this.httpProcessor = new ImmutableHttpProcessor( new RequestContent(), new RequestTargetHost(), new RequestClientConnControl(), new RequestUserAgent(VersionInfo.getUserAgent( "Apache-HttpClient", "org.apache.http.client", getClass()))); this.requestExecutor = requestExecutor; this.connManager = connManager; this.reuseStrategy = reuseStrategy; this.keepAliveStrategy = keepAliveStrategy; }
public MinimalClientExec( final HttpRequestExecutor requestExecutor, final HttpClientConnectionManager connManager, final ConnectionReuseStrategy reuseStrategy, final ConnectionKeepAliveStrategy keepAliveStrategy) { Args.notNull(requestExecutor, "HTTP request executor"); Args.notNull(connManager, "Client connection manager"); Args.notNull(reuseStrategy, "Connection reuse strategy"); Args.notNull(keepAliveStrategy, "Connection keep alive strategy"); this.httpProcessor = new ImmutableHttpProcessor( new RequestContent(), new RequestTargetHost(), new RequestClientConnControl(), new RequestUserAgent(VersionInfo.getUserAgent( "Apache-HttpClient", "org.apache.http.client", getClass()))); this.requestExecutor = requestExecutor; this.connManager = connManager; this.reuseStrategy = reuseStrategy; this.keepAliveStrategy = keepAliveStrategy; }
public TargetConfiguration(ConfigurationContext configurationContext, ParameterInclude parameters, WorkerPool pool, PassThroughTransportMetricsCollector metrics, ProxyAuthenticator proxyAuthenticator) { super(configurationContext, parameters, pool, metrics); httpProcessor = new ImmutableHttpProcessor( new HttpRequestInterceptor[] { new RequestContent(), new RequestTargetHost(), new RequestConnControl(), new RequestUserAgent(), new RequestExpectContinue() }); this.connectionTimeoutConfiguration = new ConnectionTimeoutConfiguration(conf.getConnectionIdleTime(), conf.getMaximumConnectionLifespan()); this.proxyAuthenticator = proxyAuthenticator; }
public BenchmarkWorker( final HttpRequest request, final HttpHost targetHost, final SocketFactory socketFactory, final Config config) { super(); this.context = new HttpCoreContext(); this.request = request; this.targetHost = targetHost; this.config = config; this.httpProcessor = new ImmutableHttpProcessor( new RequestContent(), new RequestTargetHost(), new RequestConnControl(), new RequestUserAgent("HttpCore-AB/1.1"), new RequestExpectContinue(this.config.isUseExpectContinue())); this.httpexecutor = new HttpRequestExecutor(); this.connstrategy = DefaultConnectionReuseStrategy.INSTANCE; this.socketFactory = socketFactory; }
.add(new RequestContent()) .add(new RequestTargetHost()) .add(new RequestConnControl()) .add(new RequestUserAgent("Test/1.1"))
new RequestContent(), new RequestTargetHost(),