Skip to main content

Module response

Module response 

Source
Expand description

Incoming response type.

A Response holds the HTTP status, version, headers, final URL, and a body handle. The body can be consumed in two ways:

  • Buffered: bytes() or text() collects the entire body.
  • Streaming: bytes_stream() yields decoded body chunks incrementally; raw_bytes_stream() selects encoded chunks for compressed responses.

§Body ownership

The body can be consumed exactly once. After calling bytes(), text(), bytes_stream(), or raw_bytes_stream(), further reads return an error.

Structs§

HistoryEntry
A metadata-only snapshot of a redirect response.
Response
An HTTP response.