cfboom.http.client

Interface ClientHttpResponse

cfboom.http.HttpMessage
    extended by cfboom.http.HttpResponse
      extended by cfboom.http.client.ClientHttpResponse
All Known Implementing Classes:
AbstractClientHttpResponse , SimpleClientHttpResponse

Represents a client-side HTTP response. Obtained via an calling of the {@link ClientHttpRequest#execute()}.

A {@code ClientHttpResponse} must be {@linkplain #close() closed}, typically in a {@code finally} block.

Class Attributes:
  • cfboom : Joel Tobey
  •  
  • displayname : Interface ClientHttpResponse
  •  
  • since : 3.0
  •  
  • author : Arjen Poutsma
  •  
    Method Summary
    void close()
         Close this response, freeing any resources created.
    any getBody()
         Return the body of the message as an input stream.
    numeric getRawStatusCode()
         Return the HTTP status code of the response as integer.
    HttpStatus getStatusCode()
         Return the HTTP status code of the response.
    string getStatusText()
         Return the HTTP status text of the response.
     
    Methods inherited from class cfboom.http.HttpResponse
    getCode, getReasonPhrase, getRequest, isClientError, isInformational, isRedirection, isServerError, isSuccess, setRequest
     
    Methods inherited from class cfboom.http.HttpMessage
    addHeader, containsHeader, getAllHeaders, getContentEncoding, getContentLength, getContentType, getFirstHeader, getHeaders, getLastHeader, removeHeaders, setHeader, setHeaders

    Method Detail

    close

    public void close()

    Close this response, freeing any resources created.


    getBody

    public any getBody()

    Return the body of the message as an input stream.

    Returns:
    the input stream body (never {@code null})
    Throws:
    IOException in case of I/O Errors

    getRawStatusCode

    public numeric getRawStatusCode()

    Return the HTTP status code of the response as integer

    Returns:
    the HTTP status as an integer
    Throws:
    IOException in case of I/O errors

    getStatusCode

    public HttpStatus getStatusCode()

    Return the HTTP status code of the response.

    Returns:
    the HTTP status as an HttpStatus enum value
    Throws:
    IOException in case of I/O errors

    getStatusText

    public string getStatusText()

    Return the HTTP status text of the response.

    Returns:
    the HTTP status text
    Throws:
    IOException in case of I/O errors