Search results

There are no results.

std.net.http.Response

type pub Response

An HTTP response parsed from some input stream.

Connection reuse

If a Response is parsed in response to a request produced by a RequestBuilder, the underlying stream is a ActiveConnection. When dropping such a connection, the connection is kept alive if:

  1. keep-alive is enabled by the Client used to produce the request
  2. The response version is 1.1 and the Connection header is missing, or its value is set to keep-alive

Fields

version

let pub @version: Version

The HTTP protocol version.

status

let pub @status: Status

The HTTP status code.

headers

let pub @headers: HeaderMap

The headers of the request.

body

let pub @body: Body

The body of the request.

Instance methods

fmt

Show source code
Hide source code
fn pub fmt(formatter: mut Formatter) {
  formatter
    .object('Response')
    .field('version', @version)
    .field('status', @status)
    .field('headers', @headers)
    .field('body', @body)
    .finish
}
fn pub fmt(formatter: mut Formatter)

Formats self in a human-readable format for debugging purposes.

Implemented traits

std.drop.

Drop

impl Drop for Response
std.fmt.

Format

impl Format for Response