Interface HttpClientResponse

  • All Known Implementing Classes:
    SimpleHttpClientResponse

    public interface HttpClientResponse
    Models the response that a script can receive from sending a HttpClientRequest over a HttpClient. Is designed to be a basic HTTP/1.1 response. See http://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html#sec6 NB: 'HttpClientResponse' used rather than 'Response' to avoid clashes with org.restlet.Response.
    Since:
    12.0.0
    • Method Detail

      • getStatusCode

        Integer getStatusCode()
        Retrieve the status code of the accessed resource.
        Returns:
        A three digit integer that corresponds to an HTTP status code. Can be null if no status code was set.
      • getReasonPhrase

        String getReasonPhrase()
        Retrieve the reason phrase of the accessed resource.
        Returns:
        The HTTP reason phrase. Can be null if no status code was set.
      • hasHeaders

        boolean hasHeaders()
        Indicates if the accessed resource has headers.
        Returns:
        True if the accessed resource has headers.
      • getHeaders

        Map<String,​String> getHeaders()
        Retrieve the headers sent with the accessed resource.
        Returns:
        The headers sent with the accessed resource. Can be implemented as returning null or an empty map in the absence of any headers.
      • getEntity

        String getEntity()
        Retrieve the entity sent with the accessed resource.
        Returns:
        The entity sent with the accessed resource. Can be null if no entity was set.
      • hasCookies

        boolean hasCookies()
        Indicates if the accessed resource had cookies.
        Returns:
        True if the accessed resource had cookies.
      • getCookies

        Map<String,​String> getCookies()
        Retrieve any cookies sent with the accessed resource.
        Returns:
        Any cookies sent with the accessed resource. Can be implemented as returning null or an empty map in the absence of any cookies.