Interface HttpClientRequest

All Known Implementing Classes:
SimpleHttpClientRequest

public interface HttpClientRequest
Models the request that a script can send over a HttpClient. Is designed to be a basic HTTP/1.1 request. See http://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html#sec5 NB: 'HttpClientRequest' used rather than 'Request' to avoid clashes with org.restlet.Request.
Since:
12.0.0
  • Method Details

    • addHeader

      void addHeader(String field, String value)
      Add a header field to the request.
      Parameters:
      field - The name of the header field to add.
      value - The value of the header field.
    • addQueryParameter

      void addQueryParameter(String field, String value)
      Add a query parameter to the request.
      Parameters:
      field - The name of the query parameter field to add.
      value - The value of the query parameter field.
    • addCookie

      void addCookie(String domain, String field, String value)
      Add a cookie to the request.
      Parameters:
      field - The name of the cookie field to add.
      value - The value of the cookie field.
    • setMethod

      void setMethod(String method)
      Set the method the request will use.
      Parameters:
      method - The method to use. See http://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html#sec5.1.1
    • setUri

      void setUri(String uri)
      Set the URI that the request targets.
      Parameters:
      uri - The URI of the resource.
    • setEntity

      void setEntity(String entity)
      Set the message entity.
      Parameters:
      entity - The entity.
    • getHeaders

      Map<String,String> getHeaders()
      Retrieve the headers set on the request.
      Returns:
      The headers set on the request.
    • getQueryParameters

      Map<String,String> getQueryParameters()
      Retrieve the query parameters set on the request.
      Returns:
      The query parameters set on the request.
    • getCookies

      Retrieve the cookies set on the request.
      Returns:
      The cookies set on the request.
    • getMethod

      String getMethod()
      Retrieve the method set on the request.
      Returns:
      The method set on the request.
    • getUri

      String getUri()
      Retrieve the URI that the request targets.
      Returns:
      The URI that the request targets.
    • getEntity

      String getEntity()
      Retrieve the entity set on the request.
      Returns:
      The entity set on the request.