Struct tk_http::client::Head [] [src]

pub struct Head<'a> { /* fields omitted */ }

A borrowed structure that represents response headers

It's passed to Codec::headers_received and you are free to store or discard any needed fields and headers from it.

Methods

impl<'a> Head<'a>
[src]

[src]

Returns status if it is one of the supported statuses otherwise None

Note: this method does not consider "reason" string at all just status code. Which is fine as specification states.

[src]

Returns raw status code and reason as received even

This returns something even if status() returned None.

Note: the reason string may not match the status code or may even be an empty string.

[src]

Iterator over the headers of HTTP request

This iterator strips the following kinds of headers:

  1. Hop-by-hop headers (Connection itself, and ones it enumerates)
  2. Content-Length and Transfer-Encoding

You may use all_headers() if you really need to access to all of them (mostly useful for debugging puproses). But you may want to consider:

  1. Payload size can be fetched using body_length() method. Note: this also includes cases where length is implicitly set to zero.
  2. Connection header might be discovered with connection_close() or connection_header()

[src]

All headers of HTTP request

Unlike self.headers() this does include hop-by-hop headers. This method is here just for completeness, you shouldn't need it.

Trait Implementations

impl<'a> Debug for Head<'a>
[src]

[src]

Formats the value using the given formatter.