pub struct HttpRequest {
pub method: &'static str,
pub path: String,
pub headers: Vec<(String, String)>,
pub body: Vec<u8>,
pub timeout: Option<Duration>,
}Expand description
One request, already fully addressed: absolute URL, every header, whole body.
Owned rather than borrowed because a backend may need to move it into a spawned task, and a recorder needs to keep it after the call returns.
Fields§
§method: &'static str§path: StringPath plus query string. Not a full URL: the base is the backend’s, so a rebound endpoint changes one field rather than every call site.
headers: Vec<(String, String)>§body: Vec<u8>§timeout: Option<Duration>How long the whole exchange may take. None means the backend’s default.
Implementations§
Trait Implementations§
Source§impl Clone for HttpRequest
impl Clone for HttpRequest
Source§impl Debug for HttpRequest
Names the headers, never their values, and sizes the body rather than printing it.
impl Debug for HttpRequest
Names the headers, never their values, and sizes the body rather than printing it.
Every request on this seam carries authorization: Bearer <agent token>, and a
streaming attach also carries the minted X-aws-proxy-auth — so a derived Debug puts
two credentials in any log line, error chain, or test-failure message that formats a
request. Redacting all header values rather than allowlisting the two known ones,
because an allowlist is a list somebody has to remember to extend the next time the
platform adds a header, and the platform’s stated reason for a token map is that it
may need more than one.
The body is sized rather than shown for the same reason: an upload body is file contents, a stdin body is base64 of whatever the caller is feeding a child, and neither belongs in a log.