pub struct HttpRequest {
pub method: Method,
pub url: String,
pub headers: HashMap<String, String>,
pub body: Body,
pub config: RequestConfig,
pub tmp: Tmp,
}Expand description
HTTP request data and execution state.
Holds everything needed to issue one outgoing request: method, URL,
headers (single-value HashMap<String, String> — see
hyperlane-standards §8.1), body, and per-request config (timeout,
redirect policy, proxy, decode, etc.).
HttpRequest is constructed either via crate::RequestBuilder or
directly from its public fields, then sent via HttpRequest::send
(sync) or HttpRequest::send_async.
Fields§
§method: MethodHTTP method (Method::Get / Method::Post / …).
url: StringTarget URL (string form, parsed on send).
headers: HashMap<String, String>Request headers (single-value).
body: BodyRequest body.
config: RequestConfigPer-request config: timeout, redirects, proxy, decode, etc.
tmp: TmpInternal scratch: redirect-loop tracking + TLS root store.
Private; only HttpRequest methods touch it.
Implementations§
Source§impl HttpRequest
Inherent implementation of HttpRequest.
impl HttpRequest
Inherent implementation of HttpRequest.
Sourcepub fn send(&mut self) -> RequestResult
pub fn send(&mut self) -> RequestResult
Send the HTTP request synchronously, returning the parsed response.
§Returns
RequestResult- The parsed HTTP response, or aRequestErroron failure.
Sourcepub async fn send_async(&mut self) -> RequestResult
pub async fn send_async(&mut self) -> RequestResult
Send the HTTP request asynchronously, returning the parsed response.
§Returns
RequestResult- The parsed HTTP response, or aRequestErroron failure.
Source§impl HttpRequest
Inherent implementation of HttpRequest.
impl HttpRequest
Inherent implementation of HttpRequest.