类 HttpComponentsClientHttpRequest

所有已实现的接口:
ClientHttpRequest, HttpMessage, HttpOutputMessage, HttpRequest, StreamingHttpOutputMessage

final class HttpComponentsClientHttpRequest extends AbstractStreamingClientHttpRequest
ClientHttpRequest implementation based on Apache HttpComponents HttpClient.

Created via the HttpComponentsClientHttpRequestFactory.

从以下版本开始:
4.0
作者:
Oleg Kalnichevski, Arjen Poutsma, Juergen Hoeller, Harry Yang
另请参阅:
  • 字段详细资料

    • httpClient

      private final HttpClient httpClient
    • httpContext

      private final org.apache.hc.core5.http.protocol.HttpContext httpContext
    • httpRequest

      private final org.apache.hc.core5.http.ClassicHttpRequest httpRequest
    • method

      private final HttpMethod method
  • 构造器详细资料

    • HttpComponentsClientHttpRequest

      HttpComponentsClientHttpRequest(HttpClient client, org.apache.hc.core5.http.ClassicHttpRequest request, org.apache.hc.core5.http.protocol.HttpContext context)
  • 方法详细资料

    • getMethod

      public HttpMethod getMethod()
      从接口复制的说明: HttpRequest
      Return the HTTP method of the request.
      返回:
      the HTTP method as an HttpMethod value
      另请参阅:
    • getURI

      public URI getURI()
      从接口复制的说明: HttpRequest
      Return the URI of the request (including a query string if any, but only if it is well-formed for a URI representation).
      返回:
      the URI of the request (never null)
    • getHttpContext

      org.apache.hc.core5.http.protocol.HttpContext getHttpContext()
    • executeInternal

      protected ClientHttpResponse executeInternal(HttpHeaders headers, @Nullable StreamingHttpOutputMessage.Body body) throws IOException
      从类复制的说明: AbstractStreamingClientHttpRequest
      Abstract template method that writes the given headers and content to the HTTP request.
      指定者:
      executeInternal 在类中 AbstractStreamingClientHttpRequest
      参数:
      headers - the HTTP headers
      body - the HTTP body, may be null if no body was set
      返回:
      the response object for the executed request
      抛出:
      IOException
    • addHeaders

      static void addHeaders(org.apache.hc.core5.http.ClassicHttpRequest httpRequest, HttpHeaders headers)
      Add the given headers to the given HTTP request.
      参数:
      httpRequest - the request to add the headers to
      headers - the headers to add