Class HttpResponse


  • public class HttpResponse
    extends Object
    The response to an HTTP request over the HTTP service.
    • Constructor Detail

      • HttpResponse

        public HttpResponse​(String status,
                            int statusCode,
                            long contentLength,
                            Map<String,​Collection<String>> headers,
                            Map<String,​HttpCookie> cookies,
                            byte[] body)
        Constructs a new response to an HTTP request.
        Parameters:
        status - the human readable status of the response.
        statusCode - the status code of the response.
        contentLength - the content length of the response.
        headers - the response headers.
        cookies - the response cookies.
        body - the response body.
    • Method Detail

      • getStatus

        @Nonnull
        public String getStatus()
        Returns the human readable status of the response.
        Returns:
        the human readable status of the response.
      • getStatusCode

        public int getStatusCode()
        Returns the status code of the response.
        Returns:
        the status code of the response.
      • getContentLength

        public long getContentLength()
        Returns the content length of the response.
        Returns:
        the content length of the response.
      • getBody

        @Nullable
        public byte[] getBody()
        Returns a copy of the response body.
        Returns:
        a copy of the response body.