org.eclipse.jetty.client.api.Request.attribute()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(2.4k)|赞(0)|评价(0)|浏览(97)

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

Request.attribute介绍

暂无

代码示例

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

public static void setPreserveAuthorization(Request request, boolean preserveAuthorization)
{
  request.attribute(PRESERVE_AUTHORIZATION_KEY, preserveAuthorization);
}

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

public static void setPreserveAuthorization(Request request, boolean preserveAuthorization)
{
  request.attribute(PRESERVE_AUTHORIZATION_KEY, preserveAuthorization);
}

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

proxyRequest.attribute(CLIENT_REQUEST_ATTRIBUTE, clientRequest);
proxyRequest.attribute(CONTINUE_ACTION_ATTRIBUTE, (Runnable)() ->

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

proxyRequest.attribute(CLIENT_REQUEST_ATTRIBUTE, request);
proxyRequest.attribute(CONTINUE_ACTION_ATTRIBUTE, (Runnable)() ->

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

@Override
public void onSuccess(Response response)
{
  // Handling of success must be done here and not from onComplete(),
  // since the onComplete() is not invoked because the request is not completed yet.
  Request request = response.getRequest();
  HttpConversation conversation = ((HttpRequest)request).getConversation();
  // Mark the 100 Continue response as handled
  request.attribute(ATTRIBUTE, Boolean.TRUE);
  // Reset the conversation listeners, since we are going to receive another response code
  conversation.updateResponseListeners(null);
  HttpExchange exchange = conversation.getExchanges().peekLast();
  if (response.getStatus() == HttpStatus.CONTINUE_100)
  {
    // All good, continue.
    exchange.resetResponse();
    exchange.proceed(null);
    onContinue(request);
  }
  else
  {
    // Server either does not support 100 Continue,
    // or it does and wants to refuse the request content,
    // or we got some other HTTP status code like a redirect.
    List<Response.ResponseListener> listeners = exchange.getResponseListeners();
    HttpContentResponse contentResponse = new HttpContentResponse(response, getContent(), getMediaType(), getEncoding());
    notifier.forwardSuccess(listeners, contentResponse);
    exchange.proceed(new HttpRequestException("Expectation failed", request));
  }
}

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

conversation.setAttribute(EndPoint.class.getName(), endPoint);
connect.attribute(Connection.class.getName(), new ProxyConnection(destination, connection, promise));

相关文章