io.airlift.http.client.Request.getHeaders()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(6.5k)|赞(0)|评价(0)|浏览(266)

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

Request.getHeaders介绍

暂无

代码示例

代码示例来源:origin: prestodb/presto

  1. assertTrue(!request.getHeaders().get(PrestoHeaders.PRESTO_MAX_SIZE).isEmpty());
  2. DataSize maxSize = DataSize.valueOf(request.getHeader(PrestoHeaders.PRESTO_MAX_SIZE));
  3. assertEquals(maxSize, expectedMaxSize);

代码示例来源:origin: io.airlift/http-client

  1. @Test
  2. public void testRequestBuilder()
  3. {
  4. Request request = createRequest();
  5. assertEquals(request.getMethod(), "GET");
  6. assertEquals(request.getBodyGenerator(), NULL_BODY_GENERATOR);
  7. assertEquals(request.getUri(), URI.create("http://example.com"));
  8. assertEquals(request.getHeaders(), ImmutableListMultimap.of(
  9. "newheader", "withvalue", "anotherheader", "anothervalue"));
  10. assertFalse(request.isFollowRedirects());
  11. }

代码示例来源:origin: com.teradata.airlift/http-client

  1. @Test
  2. public void testRequestBuilder()
  3. {
  4. Request request = createRequest();
  5. assertEquals(request.getMethod(), "GET");
  6. assertEquals(request.getBodyGenerator(), NULL_BODY_GENERATOR);
  7. assertEquals(request.getUri(), URI.create("http://example.com"));
  8. assertEquals(request.getHeaders(), ImmutableListMultimap.of(
  9. "newheader", "withvalue", "anotherheader", "anothervalue"));
  10. }

代码示例来源:origin: io.airlift/http-client-experimental

  1. @Test
  2. public void testRequestBuilder()
  3. {
  4. Request request = createRequest();
  5. assertEquals(request.getMethod(), "GET");
  6. assertEquals(request.getBodyGenerator(), NULL_BODY_GENERATOR);
  7. assertEquals(request.getUri(), URI.create("http://example.com"));
  8. assertEquals(request.getHeaders(), ImmutableListMultimap.of(
  9. "newheader", "withvalue", "anotherheader", "anothervalue"));
  10. }

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

  1. @Test
  2. public void testRequestBuilder()
  3. {
  4. Request request = createRequest();
  5. assertEquals(request.getMethod(), "GET");
  6. assertEquals(request.getBodyGenerator(), NULL_BODY_GENERATOR);
  7. assertEquals(request.getUri(), URI.create("http://example.com"));
  8. assertEquals(request.getHeaders(), ImmutableListMultimap.of(
  9. "newheader", "withvalue", "anotherheader", "anothervalue"));
  10. assertFalse(request.isFollowRedirects());
  11. }

代码示例来源:origin: io.airlift/http-client

  1. @Test
  2. public void testBasic()
  3. {
  4. TraceTokenManager manager = new TraceTokenManager();
  5. manager.registerRequestToken("testBasic");
  6. TraceTokenRequestFilter filter = new TraceTokenRequestFilter(manager);
  7. Request original = prepareGet().setUri(URI.create("http://example.com")).build();
  8. Request filtered = filter.filterRequest(original);
  9. assertNotSame(filter, original);
  10. assertEquals(filtered.getUri(), original.getUri());
  11. assertEquals(original.getHeaders().size(), 0);
  12. assertEquals(filtered.getHeaders().size(), 1);
  13. assertEquals(filtered.getHeaders().get(TRACETOKEN_HEADER), ImmutableList.of("testBasic"));
  14. }

代码示例来源:origin: io.airlift/http-client-experimental

  1. @Test
  2. public void testBasic()
  3. {
  4. TraceTokenManager manager = new TraceTokenManager();
  5. manager.registerRequestToken("testBasic");
  6. TraceTokenRequestFilter filter = new TraceTokenRequestFilter(manager);
  7. Request original = prepareGet().setUri(URI.create("http://example.com")).build();
  8. Request filtered = filter.filterRequest(original);
  9. assertNotSame(filter, original);
  10. assertEquals(filtered.getUri(), original.getUri());
  11. assertEquals(original.getHeaders().size(), 0);
  12. assertEquals(filtered.getHeaders().size(), 1);
  13. assertEquals(filtered.getHeaders().get(TRACETOKEN_HEADER), ImmutableList.of("testBasic"));
  14. }

代码示例来源:origin: com.teradata.airlift/http-client

  1. @Test
  2. public void testBasic()
  3. {
  4. TraceTokenManager manager = new TraceTokenManager();
  5. manager.registerRequestToken("testBasic");
  6. TraceTokenRequestFilter filter = new TraceTokenRequestFilter(manager);
  7. Request original = prepareGet().setUri(URI.create("http://example.com")).build();
  8. Request filtered = filter.filterRequest(original);
  9. assertNotSame(filter, original);
  10. assertEquals(filtered.getUri(), original.getUri());
  11. assertEquals(original.getHeaders().size(), 0);
  12. assertEquals(filtered.getHeaders().size(), 1);
  13. assertEquals(filtered.getHeaders().get(TRACETOKEN_HEADER), ImmutableList.of("testBasic"));
  14. }

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

  1. @Test
  2. public void testBasic()
  3. {
  4. TraceTokenManager manager = new TraceTokenManager();
  5. manager.registerRequestToken("testBasic");
  6. TraceTokenRequestFilter filter = new TraceTokenRequestFilter(manager);
  7. Request original = prepareGet().setUri(URI.create("http://example.com")).build();
  8. Request filtered = filter.filterRequest(original);
  9. assertNotSame(filter, original);
  10. assertEquals(filtered.getUri(), original.getUri());
  11. assertEquals(original.getHeaders().size(), 0);
  12. assertEquals(filtered.getHeaders().size(), 1);
  13. assertEquals(filtered.getHeaders().get(TRACETOKEN_HEADER), ImmutableList.of("testBasic"));
  14. }

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

  1. for (Map.Entry<String, String> entry : request.getHeaders().entries()) {
  2. requestHeaders.add(entry.getKey(), entry.getValue());

代码示例来源:origin: io.airlift/jaxrs-testing

  1. for (Map.Entry<String, String> entry : request.getHeaders().entries()) {
  2. requestHeaders.add(entry.getKey(), entry.getValue());

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

  1. public static Builder fromRequest(Request request)
  2. {
  3. return new Builder()
  4. .setUri(request.getUri())
  5. .setMethod(request.getMethod())
  6. .addHeaders(request.getHeaders())
  7. .setBodyGenerator(request.getBodyGenerator())
  8. .setFollowRedirects(request.isFollowRedirects())
  9. .setPreserveAuthorizationOnRedirect(request.isPreserveAuthorizationOnRedirect());
  10. }

代码示例来源:origin: prestosql/presto

  1. assertTrue(!request.getHeaders().get(PrestoHeaders.PRESTO_MAX_SIZE).isEmpty());
  2. DataSize maxSize = DataSize.valueOf(request.getHeader(PrestoHeaders.PRESTO_MAX_SIZE));
  3. assertEquals(maxSize, expectedMaxSize);

代码示例来源:origin: io.prestosql/presto-main

  1. assertTrue(!request.getHeaders().get(PrestoHeaders.PRESTO_MAX_SIZE).isEmpty());
  2. DataSize maxSize = DataSize.valueOf(request.getHeader(PrestoHeaders.PRESTO_MAX_SIZE));
  3. assertEquals(maxSize, expectedMaxSize);

代码示例来源:origin: uk.co.nichesolutions.presto/presto-main

  1. assertTrue(!request.getHeaders().get(PrestoHeaders.PRESTO_MAX_SIZE).isEmpty());
  2. DataSize maxSize = DataSize.valueOf(request.getHeader(PrestoHeaders.PRESTO_MAX_SIZE));
  3. assertEquals(maxSize, expectedMaxSize);

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

  1. for (Entry<String, String> entry : finalRequest.getHeaders().entries()) {
  2. jettyRequest.header(entry.getKey(), entry.getValue());

相关文章