Package core :: Module http :: Class HttpClientResponse

[hide private]
[frames] | no frames]

# Class HttpClientResponse

source code

            object --+
                     |
    streams.ReadStream --+
                         |
                        HttpClientResponse

Encapsulates a client-side HTTP response.

An instance of this class is provided to the user via a handler that was specified when one of the HTTP method operations, or the generic HttpClientrequest method was called on an instance of HttpClient.

Instance Methods | [hide private]

__init__(self, java_obj) | source code

status_code(self) return the HTTP status code of the response. | source code

header(self, key) Get a header value | source code

headers(self) Get all the headers in the response. | source code

trailers(self) Get all the trailers in the response. | source code

body_handler(self, handler) Set a handler to receive the entire body in one go - do not use this for large bodies | source code

Inherited from `streams.ReadStream`: `data_handler`, `end_handler`, `exception_handler`, `pause`, `resume` Inherited from `streams.ReadStream` (private): `_to_read_stream`

Method Details | [hide private]

### __init__(self, java_obj)
(Constructor)

source code

Overrides: object.__init__
  (inherited documentation)

### status_code(self)

source code

return the HTTP status code of the response.

Decorators:
  - `@property`

### header(self, key)

source code

Get a header value

Keyword arguments:

Parameters:
  - `key` - The key of the header.

    return the header value.

### headers(self)

source code

Get all the headers in the response. If the response contains multiple headers with the same key, the values will be concatenated together into a single header with the same key value, with each value separated by a comma, as specified by {http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.htmlsec4.2}. return a dictionary of headers.

Decorators:
  - `@property`

### trailers(self)

source code

Get all the trailers in the response. If the response contains multiple trailers with the same key, the values will be concatenated together into a single header with the same key value, with each value separated by a comma, as specified by {http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.htmlsec4.2}. Trailers will only be available in the response if the server has sent a HTTP chunked response where headers have been inserted by the server on the last chunk. In such a case they won't be available on the client until the last chunk has been received.

return a dictionary of trailers.

Decorators:
  - `@property`