org.eclipse.jetty.client.HttpClient.getContentDecoderFactories()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(3.1k)|赞(0)|评价(0)|浏览(146)

本文整理了Java中org.eclipse.jetty.client.HttpClient.getContentDecoderFactories()方法的一些代码示例,展示了HttpClient.getContentDecoderFactories()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HttpClient.getContentDecoderFactories()方法的具体详情如下:
包路径:org.eclipse.jetty.client.HttpClient
类名称:HttpClient
方法名:getContentDecoderFactories

HttpClient.getContentDecoderFactories介绍

[英]Returns a non thread-safe set of ContentDecoder.Factorys that can be modified before performing requests.
[中]返回一组线程安全的ContentDecoder。在执行请求之前可以修改的工厂。

代码示例

代码示例来源:origin: danielflower/app-runner

private HttpClient createClient() throws Exception {
  int selectors = Math.max(1, Runtime.getRuntime().availableProcessors() / 2);
  HttpClient client = new HttpClient(new HttpClientTransportOverHTTP(selectors), new SslContextFactory(true));
  client.setFollowRedirects(false);
  client.setCookieStore(new HttpCookieStore.Empty());
  client.setMaxConnectionsPerDestination(256);
  client.setAddressResolutionTimeout(15000);
  client.setConnectTimeout(15000);
  client.setIdleTimeout(idleTimeout);
  client.setUserAgentField(null);
  client.start();
  client.getContentDecoderFactories().clear();
  return client;
}

代码示例来源:origin: org.apache.pulsar/pulsar-proxy

client.getContentDecoderFactories().clear();

代码示例来源:origin: org.eclipse.jetty/jetty-proxy

client.getContentDecoderFactories().clear();

代码示例来源:origin: org.eclipse.jetty/jetty-client

if (contentEncodings != null)
  for (ContentDecoder.Factory factory : getHttpDestination().getHttpClient().getContentDecoderFactories())

代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9

if (contentEncodings != null)
  for (ContentDecoder.Factory factory : connection.getHttpClient().getContentDecoderFactories())

代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9

if (contentEncodings != null)
  for (ContentDecoder.Factory factory : connection.getHttpClient().getContentDecoderFactories())

代码示例来源:origin: org.infinispan/infinispan-server-rest

@Test
public void testCompression() throws Exception {
 String payload = getResourceAsString("person.proto", getClass().getClassLoader());
 putStringValueInCache("default", "k", payload);
 HttpClient uncompressingClient = new HttpClient();
 uncompressingClient.start();
 uncompressingClient.getContentDecoderFactories().clear();
 ContentResponse response = uncompressingClient
    .newRequest(String.format("http://localhost:%d/rest/%s/%s", restServer().getPort(), "default", "k"))
    .header(HttpHeader.ACCEPT, "text/plain")
    .send();
 assertThat(response).hasNoContentEncoding();
 assertThat(response).hasContentLength(payload.getBytes().length);
 client.getContentDecoderFactories().clear();
 response = uncompressingClient
    .newRequest(String.format("http://localhost:%d/rest/%s/%s", restServer().getPort(), "default", "k"))
    .header(HttpHeader.ACCEPT, "text/plain")
    .header(ACCEPT_ENCODING, "gzip")
    .send();
 assertThat(response).hasGzipContentEncoding();
 assertEquals(decompress(response.getContent()), payload);
}

代码示例来源:origin: airlift/airlift

httpClient.getContentDecoderFactories().clear();

代码示例来源:origin: com.proofpoint.platform/http-client

this.httpClient.getContentDecoderFactories().clear();

相关文章

HttpClient类方法