pub struct HttpFetchRequest {
pub method: String,
pub url: String,
pub headers: Vec<(String, String)>,
pub body: Vec<u8>,
pub timeout_ms: Option<u32>,
pub follow_redirects: Option<u32>,
pub verify_tls: Option<bool>,
}Expand description
Outbound HTTP request data passed to HttpFetchBackend.
Mirrors the WIT http-fetch-request record exactly. The
From<http::Request<Bytes>> / TryFrom<HttpFetchRequest> pair
below is the single conversion seam between this wire-shape struct
and http::Request — engine call sites use those helpers rather
than hand-rolling header / body / URI translation.
Fields§
§method: String§url: String§headers: Vec<(String, String)>§body: Vec<u8>§timeout_ms: Option<u32>§follow_redirects: Option<u32>§verify_tls: Option<bool>Implementations§
Source§impl HttpFetchRequest
impl HttpFetchRequest
Sourcepub fn from_http_request(req: &Request<Bytes>) -> Self
pub fn from_http_request(req: &Request<Bytes>) -> Self
Build a HttpFetchRequest from a borrowed http::Request<Bytes>.
body is cloned from the inner Bytes (refcount bump, no copy
unless the Bytes is being unbundled). Header values that fail
to_str are skipped — the WIT wire shape mandates UTF-8 strings,
and the engine surface decides upstream whether non-UTF-8 names
should hard-reject.
Trait Implementations§
Source§impl Debug for HttpFetchRequest
impl Debug for HttpFetchRequest
Source§impl TryFrom<&HttpFetchRequest> for Request<Bytes>
impl TryFrom<&HttpFetchRequest> for Request<Bytes>
Auto Trait Implementations§
impl Freeze for HttpFetchRequest
impl RefUnwindSafe for HttpFetchRequest
impl Send for HttpFetchRequest
impl Sync for HttpFetchRequest
impl Unpin for HttpFetchRequest
impl UnsafeUnpin for HttpFetchRequest
impl UnwindSafe for HttpFetchRequest
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more