本文整理了Java中org.eclipse.jetty.client.api.Request.getAttributes
方法的一些代码示例,展示了Request.getAttributes
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Request.getAttributes
方法的具体详情如下:
包路径:org.eclipse.jetty.client.api.Request
类名称:Request
方法名:getAttributes
暂无
代码示例来源:origin: resteasy/Resteasy
private void configureTimeout(final Request request) {
final Object timeout = request.getAttributes().get(REQUEST_TIMEOUT_MS);
final long timeoutMs;
if (timeout instanceof Duration) {
timeoutMs = ((Duration) timeout).toMillis();
} else if (timeout instanceof Number) {
timeoutMs = ((Number) timeout).intValue();
} else if (timeout != null) {
timeoutMs = Integer.parseInt(timeout.toString());
} else {
timeoutMs = -1;
}
if (timeoutMs > 0) {
request.timeout(timeoutMs, TimeUnit.MILLISECONDS);
}
}
代码示例来源:origin: resteasy/Resteasy
invocation.getHeaders().asMap().forEach((h, vs) -> vs.forEach(v -> request.header(h, v)));
configureTimeout(request);
if (request.getAttributes().get(FOLLOW_REDIRECTS) == Boolean.FALSE) {
request.followRedirects(false);
代码示例来源:origin: airlift/airlift
private static boolean isPreserveAuthorization(Request request)
{
return (boolean) request.getAttributes().get(PRESERVE_AUTHORIZATION_KEY);
}
}
代码示例来源:origin: com.proofpoint.platform/http-client
private static boolean isPreserveAuthorization(Request request)
{
return (boolean) request.getAttributes().get(PRESERVE_AUTHORIZATION_KEY);
}
}
代码示例来源:origin: airlift/airlift
static List<JettyRequestListener> getRequestListenersForDestination(Destination destination)
{
return getRequestForDestination(destination).stream()
.map(request -> request.getAttributes().get(STATS_KEY))
.map(JettyRequestListener.class::cast)
.filter(Objects::nonNull)
.collect(Collectors.toList());
}
代码示例来源:origin: com.proofpoint.platform/http-client
static List<JettyRequestListener> getRequestListenersForDestination(Destination destination)
{
return getRequestForDestination(destination).stream()
.map(request -> request.getAttributes().get(PLATFORM_STATS_KEY))
.map(JettyRequestListener.class::cast)
.filter(Objects::nonNull)
.collect(Collectors.toList());
}
代码示例来源:origin: org.eclipse.jetty/jetty-proxy
@Override
protected void onContinue(Request request)
{
HttpServletRequest clientRequest = (HttpServletRequest)request.getAttributes().get(CLIENT_REQUEST_ATTRIBUTE);
AbstractProxyServlet.this.onContinue(clientRequest, request);
}
}
代码示例来源:origin: org.eclipse.jetty/jetty-proxy
@Override
protected void onContinue(HttpServletRequest clientRequest, Request proxyRequest)
{
super.onContinue(clientRequest, proxyRequest);
Runnable action = (Runnable)proxyRequest.getAttributes().get(CONTINUE_ACTION_ATTRIBUTE);
action.run();
}
代码示例来源:origin: org.eclipse.jetty/jetty-proxy
@Override
protected void onContinue(HttpServletRequest clientRequest, Request proxyRequest)
{
super.onContinue(clientRequest, proxyRequest);
Runnable action = (Runnable)proxyRequest.getAttributes().get(CONTINUE_ACTION_ATTRIBUTE);
Executor executor = getHttpClient().getExecutor();
executor.execute(action);
}
代码示例来源:origin: org.eclipse.jetty/jetty-client
@Override
public boolean accept(Request request, Response response)
{
boolean is100 = response.getStatus() == HttpStatus.CONTINUE_100;
boolean expect100 = request.getHeaders().contains(HttpHeader.EXPECT, HttpHeaderValue.CONTINUE.asString());
boolean handled100 = request.getAttributes().containsKey(ATTRIBUTE);
return (is100 || expect100) && !handled100;
}
内容来源于网络,如有侵权,请联系作者删除!