本文整理了Java中io.airlift.http.client.Request.getHeaders
方法的一些代码示例,展示了Request.getHeaders
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Request.getHeaders
方法的具体详情如下:
包路径:io.airlift.http.client.Request
类名称:Request
方法名:getHeaders
暂无
代码示例来源:origin: prestodb/presto
assertTrue(!request.getHeaders().get(PrestoHeaders.PRESTO_MAX_SIZE).isEmpty());
DataSize maxSize = DataSize.valueOf(request.getHeader(PrestoHeaders.PRESTO_MAX_SIZE));
assertEquals(maxSize, expectedMaxSize);
代码示例来源:origin: io.airlift/http-client
@Test
public void testRequestBuilder()
{
Request request = createRequest();
assertEquals(request.getMethod(), "GET");
assertEquals(request.getBodyGenerator(), NULL_BODY_GENERATOR);
assertEquals(request.getUri(), URI.create("http://example.com"));
assertEquals(request.getHeaders(), ImmutableListMultimap.of(
"newheader", "withvalue", "anotherheader", "anothervalue"));
assertFalse(request.isFollowRedirects());
}
代码示例来源:origin: com.teradata.airlift/http-client
@Test
public void testRequestBuilder()
{
Request request = createRequest();
assertEquals(request.getMethod(), "GET");
assertEquals(request.getBodyGenerator(), NULL_BODY_GENERATOR);
assertEquals(request.getUri(), URI.create("http://example.com"));
assertEquals(request.getHeaders(), ImmutableListMultimap.of(
"newheader", "withvalue", "anotherheader", "anothervalue"));
}
代码示例来源:origin: io.airlift/http-client-experimental
@Test
public void testRequestBuilder()
{
Request request = createRequest();
assertEquals(request.getMethod(), "GET");
assertEquals(request.getBodyGenerator(), NULL_BODY_GENERATOR);
assertEquals(request.getUri(), URI.create("http://example.com"));
assertEquals(request.getHeaders(), ImmutableListMultimap.of(
"newheader", "withvalue", "anotherheader", "anothervalue"));
}
代码示例来源:origin: airlift/airlift
@Test
public void testRequestBuilder()
{
Request request = createRequest();
assertEquals(request.getMethod(), "GET");
assertEquals(request.getBodyGenerator(), NULL_BODY_GENERATOR);
assertEquals(request.getUri(), URI.create("http://example.com"));
assertEquals(request.getHeaders(), ImmutableListMultimap.of(
"newheader", "withvalue", "anotherheader", "anothervalue"));
assertFalse(request.isFollowRedirects());
}
代码示例来源:origin: io.airlift/http-client
@Test
public void testBasic()
{
TraceTokenManager manager = new TraceTokenManager();
manager.registerRequestToken("testBasic");
TraceTokenRequestFilter filter = new TraceTokenRequestFilter(manager);
Request original = prepareGet().setUri(URI.create("http://example.com")).build();
Request filtered = filter.filterRequest(original);
assertNotSame(filter, original);
assertEquals(filtered.getUri(), original.getUri());
assertEquals(original.getHeaders().size(), 0);
assertEquals(filtered.getHeaders().size(), 1);
assertEquals(filtered.getHeaders().get(TRACETOKEN_HEADER), ImmutableList.of("testBasic"));
}
代码示例来源:origin: io.airlift/http-client-experimental
@Test
public void testBasic()
{
TraceTokenManager manager = new TraceTokenManager();
manager.registerRequestToken("testBasic");
TraceTokenRequestFilter filter = new TraceTokenRequestFilter(manager);
Request original = prepareGet().setUri(URI.create("http://example.com")).build();
Request filtered = filter.filterRequest(original);
assertNotSame(filter, original);
assertEquals(filtered.getUri(), original.getUri());
assertEquals(original.getHeaders().size(), 0);
assertEquals(filtered.getHeaders().size(), 1);
assertEquals(filtered.getHeaders().get(TRACETOKEN_HEADER), ImmutableList.of("testBasic"));
}
代码示例来源:origin: com.teradata.airlift/http-client
@Test
public void testBasic()
{
TraceTokenManager manager = new TraceTokenManager();
manager.registerRequestToken("testBasic");
TraceTokenRequestFilter filter = new TraceTokenRequestFilter(manager);
Request original = prepareGet().setUri(URI.create("http://example.com")).build();
Request filtered = filter.filterRequest(original);
assertNotSame(filter, original);
assertEquals(filtered.getUri(), original.getUri());
assertEquals(original.getHeaders().size(), 0);
assertEquals(filtered.getHeaders().size(), 1);
assertEquals(filtered.getHeaders().get(TRACETOKEN_HEADER), ImmutableList.of("testBasic"));
}
代码示例来源:origin: airlift/airlift
@Test
public void testBasic()
{
TraceTokenManager manager = new TraceTokenManager();
manager.registerRequestToken("testBasic");
TraceTokenRequestFilter filter = new TraceTokenRequestFilter(manager);
Request original = prepareGet().setUri(URI.create("http://example.com")).build();
Request filtered = filter.filterRequest(original);
assertNotSame(filter, original);
assertEquals(filtered.getUri(), original.getUri());
assertEquals(original.getHeaders().size(), 0);
assertEquals(filtered.getHeaders().size(), 1);
assertEquals(filtered.getHeaders().get(TRACETOKEN_HEADER), ImmutableList.of("testBasic"));
}
代码示例来源:origin: airlift/airlift
for (Map.Entry<String, String> entry : request.getHeaders().entries()) {
requestHeaders.add(entry.getKey(), entry.getValue());
代码示例来源:origin: io.airlift/jaxrs-testing
for (Map.Entry<String, String> entry : request.getHeaders().entries()) {
requestHeaders.add(entry.getKey(), entry.getValue());
代码示例来源:origin: airlift/airlift
public static Builder fromRequest(Request request)
{
return new Builder()
.setUri(request.getUri())
.setMethod(request.getMethod())
.addHeaders(request.getHeaders())
.setBodyGenerator(request.getBodyGenerator())
.setFollowRedirects(request.isFollowRedirects())
.setPreserveAuthorizationOnRedirect(request.isPreserveAuthorizationOnRedirect());
}
代码示例来源:origin: prestosql/presto
assertTrue(!request.getHeaders().get(PrestoHeaders.PRESTO_MAX_SIZE).isEmpty());
DataSize maxSize = DataSize.valueOf(request.getHeader(PrestoHeaders.PRESTO_MAX_SIZE));
assertEquals(maxSize, expectedMaxSize);
代码示例来源:origin: io.prestosql/presto-main
assertTrue(!request.getHeaders().get(PrestoHeaders.PRESTO_MAX_SIZE).isEmpty());
DataSize maxSize = DataSize.valueOf(request.getHeader(PrestoHeaders.PRESTO_MAX_SIZE));
assertEquals(maxSize, expectedMaxSize);
代码示例来源:origin: uk.co.nichesolutions.presto/presto-main
assertTrue(!request.getHeaders().get(PrestoHeaders.PRESTO_MAX_SIZE).isEmpty());
DataSize maxSize = DataSize.valueOf(request.getHeader(PrestoHeaders.PRESTO_MAX_SIZE));
assertEquals(maxSize, expectedMaxSize);
代码示例来源:origin: airlift/airlift
for (Entry<String, String> entry : finalRequest.getHeaders().entries()) {
jettyRequest.header(entry.getKey(), entry.getValue());
内容来源于网络,如有侵权,请联系作者删除!