/** * Creates {@link HttpProcessor} initialized with default protocol interceptors * for client side HTTP/1.1 processing. * * @param agentInfo the agent info text or {@code null} for default. * @return the processor. */ public static HttpProcessor client(final String agentInfo) { return customClient(agentInfo).build(); }
public static HttpProcessorBuilder create() { return new HttpProcessorBuilder(); }
public HttpProcessorBuilder addAll(final HttpRequestInterceptor... e) { return addAllLast(e); }
final HttpProcessorBuilder b = HttpProcessorBuilder.create(); if (requestInterceptors != null) { for (final RequestInterceptorEntry entry: requestInterceptors) { if (entry.postion == RequestInterceptorEntry.Postion.FIRST) { b.addFirst(entry.interceptor); for (final ResponseInterceptorEntry entry: responseInterceptors) { if (entry.postion == ResponseInterceptorEntry.Postion.FIRST) { b.addFirst(entry.interceptor); b.addAll( new RequestDefaultHeaders(defaultHeaders), new RequestContent(), new RequestExpectContinue()); if (!cookieManagementDisabled) { b.add(new RequestAddCookies()); b.add(new RequestAuthCache()); b.add(new ResponseProcessCookies()); b.addFirst(entry.interceptor); for (final ResponseInterceptorEntry entry: responseInterceptors) { if (entry.postion == ResponseInterceptorEntry.Postion.LAST) { b.addFirst(entry.interceptor); final HttpProcessor httpProcessor = b.build();
public static HttpProcessorBuilder customServer(final String serverInfo) { return HttpProcessorBuilder.create() .addAll( new ResponseDate(), new ResponseServer(!TextUtils.isBlank(serverInfo) ? serverInfo : VersionInfo.getSoftwareInfo(SOFTWARE, "org.apache.hc.core5", Http2Processors.class)), new H2ResponseContent(), new H2ResponseConnControl()) .addAll( new H2RequestValidateHost()); }
public Results execute() throws Exception { final HttpProcessorBuilder builder = HttpProcessorBuilder.create() .addAll( new H2RequestContent(), new H2RequestTargetHost(), new RequestUserAgent("HttpCore-AB/5.0")); if (this.config.isUseExpectContinue()) { builder.add(new RequestExpectContinue()); .setHttpProcessor(builder.build()) .setTlsStrategy(new BasicClientTlsStrategy(sslContext)) .setVersionPolicy(versionPolicy)
/** * Creates {@link HttpProcessorBuilder} initialized with default protocol interceptors * for server side HTTP/1.1 processing. * * @param serverInfo the server info text or {@code null} for default. * @return the processor builder. */ public static HttpProcessorBuilder customServer(final String serverInfo) { return HttpProcessorBuilder.create() .addAll( new ResponseDate(), new ResponseServer(!TextUtils.isBlank(serverInfo) ? serverInfo : VersionInfo.getSoftwareInfo(SOFTWARE, "org.apache.hc.core5", HttpProcessors.class)), new ResponseContent(), new ResponseConnControl()) .addAll( new RequestValidateHost()); }
public Results execute() throws Exception { final HttpProcessorBuilder builder = HttpProcessorBuilder.create() .addAll( new H2RequestContent(), new H2RequestTargetHost(), new RequestUserAgent("HttpCore-AB/5.0")); if (this.config.isUseExpectContinue()) { builder.add(new RequestExpectContinue()); .setHttpProcessor(builder.build()) .setTlsStrategy(new BasicClientTlsStrategy(sslContext)) .setVersionPolicy(versionPolicy)
/** * Creates {@link HttpProcessorBuilder} initialized with default protocol interceptors * for server side HTTP/1.1 processing. * * @param serverInfo the server info text or {@code null} for default. * @return the processor builder. */ public static HttpProcessorBuilder customServer(final String serverInfo) { return HttpProcessorBuilder.create() .addAll( new ResponseDate(), new ResponseServer(!TextUtils.isBlank(serverInfo) ? serverInfo : VersionInfo.getSoftwareInfo(SOFTWARE, "org.apache.hc.core5", HttpProcessors.class)), new ResponseContent(), new ResponseConnControl()) .addAll( new RequestValidateHost()); }
/** * Creates {@link HttpProcessor} initialized with default protocol interceptors * for server side HTTP/1.1 processing. * * @return the processor. */ public static HttpProcessor server() { return customServer(null).build(); }
public HttpProcessorBuilder addAll(final HttpResponseInterceptor... e) { return addAllLast(e); }
public static HttpProcessorBuilder create() { return new HttpProcessorBuilder(); }
final HttpProcessorBuilder b = HttpProcessorBuilder.create(); if (requestInterceptors != null) { for (final RequestInterceptorEntry entry: requestInterceptors) { if (entry.postion == RequestInterceptorEntry.Postion.FIRST) { b.addFirst(entry.interceptor); for (final ResponseInterceptorEntry entry: responseInterceptors) { if (entry.postion == ResponseInterceptorEntry.Postion.FIRST) { b.addFirst(entry.interceptor); b.addAll( new RequestDefaultHeaders(defaultHeaders), new RequestUserAgent(userAgentCopy), new RequestExpectContinue()); if (!cookieManagementDisabled) { b.add(new RequestAddCookies()); b.add(new RequestAuthCache()); b.add(new ResponseProcessCookies()); b.addFirst(entry.interceptor); for (final ResponseInterceptorEntry entry: responseInterceptors) { if (entry.postion == ResponseInterceptorEntry.Postion.LAST) { b.addFirst(entry.interceptor); final HttpProcessor httpProcessor = b.build(); execChainDefinition.addFirst(
public static HttpProcessorBuilder customClient(final String agentInfo) { return HttpProcessorBuilder.create() .addAll( new H2RequestContent(), new H2RequestTargetHost(), new H2RequestConnControl(), new RequestUserAgent(!TextUtils.isBlank(agentInfo) ? agentInfo : VersionInfo.getSoftwareInfo(SOFTWARE, "org.apache.hc.core5", HttpProcessors.class)), new RequestExpectContinue()); }
/** * Creates {@link HttpProcessor} initialized with default protocol interceptors * for client side HTTP/1.1 processing. * * @param agentInfo the agent info text or {@code null} for default. * @return the processor. */ public static HttpProcessor client(final String agentInfo) { return customClient(agentInfo).build(); }
public HttpProcessorBuilder addAll(final HttpRequestInterceptor... e) { return addAllLast(e); }
final HttpProcessorBuilder b = HttpProcessorBuilder.create(); if (requestInterceptors != null) { for (final RequestInterceptorEntry entry: requestInterceptors) { if (entry.postion == RequestInterceptorEntry.Postion.FIRST) { b.addFirst(entry.interceptor); for (final ResponseInterceptorEntry entry: responseInterceptors) { if (entry.postion == ResponseInterceptorEntry.Postion.FIRST) { b.addFirst(entry.interceptor); b.addAll( new RequestDefaultHeaders(defaultHeaders), new RequestUserAgent(userAgentCopy), new RequestExpectContinue()); if (!cookieManagementDisabled) { b.add(new RequestAddCookies()); b.add(new RequestAuthCache()); b.add(new ResponseProcessCookies()); b.addFirst(entry.interceptor); for (final ResponseInterceptorEntry entry: responseInterceptors) { if (entry.postion == ResponseInterceptorEntry.Postion.LAST) { b.addFirst(entry.interceptor); final HttpProcessor httpProcessor = b.build(); execChainDefinition.addFirst(
/** * Creates {@link HttpProcessorBuilder} initialized with default protocol interceptors * for client side HTTP/1.1 processing. * * @param agentInfo the agent info text or {@code null} for default. * @return the processor builder. */ public static HttpProcessorBuilder customClient(final String agentInfo) { return HttpProcessorBuilder.create() .addAll( new RequestContent(), new RequestTargetHost(), new RequestConnControl(), new RequestUserAgent(!TextUtils.isBlank(agentInfo) ? agentInfo : VersionInfo.getSoftwareInfo(SOFTWARE, "org.apache.hc.core5", HttpProcessors.class)), new RequestExpectContinue()); }
/** * Creates {@link HttpProcessor} initialized with default protocol interceptors * for client side HTTP/1.1 processing. * * @return the processor. */ public static HttpProcessor client() { return customClient(null).build(); }
public HttpProcessorBuilder addAll(final HttpResponseInterceptor... e) { return addAllLast(e); }