接口 HttpStack

所有已知实现类:
HttpClientStack, HurlStack

public interface HttpStack
An HTTP stack abstraction.
  • 方法概要

    修饰符和类型
    方法
    说明
    org.apache.http.HttpResponse
    performRequest(Request<?> request, Map<String,String> additionalHeaders)
    Performs an HTTP request with the given parameters.
  • 方法详细资料

    • performRequest

      org.apache.http.HttpResponse performRequest(Request<?> request, Map<String,String> additionalHeaders) throws IOException, AuthFailureError
      Performs an HTTP request with the given parameters.

      A GET request is sent if request.getPostBody() == null. A POST request is sent otherwise, and the Content-Type header is set to request.getPostBodyContentType().

      参数:
      request - the request to perform
      additionalHeaders - additional headers to be sent together with Request.getHeaders()
      返回:
      the HTTP response
      抛出:
      IOException
      AuthFailureError