std.net.http.Response
type pub ResponseAn 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:
- keep-alive is enabled by the
Clientused to produce the request - The response version is 1.1 and the
Connectionheader is missing, or its value is set tokeep-alive
Fields
version
let pub @version: VersionThe HTTP protocol version.
status
let pub @status: StatusThe HTTP status code.
headers
let pub @headers: HeaderMapThe headers of the request.
body
let pub @body: BodyThe body of the request.
Instance methods
fmt
Show source codeHide 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
Drop
impl Drop for ResponseFormat
impl Format for Response