pub struct HttpRequest { /* private fields */ }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.
Implementations§
Source§impl HttpRequest
Inherent implementation of HttpRequest.
impl HttpRequest
Inherent implementation of HttpRequest.
Sourcepub fn send(&mut self) -> Result<HttpResponse, RequestError>
pub fn send(&mut self) -> Result<HttpResponse, RequestError>
Send the HTTP request synchronously, returning the parsed response.
§Returns
Result<HttpResponse, RequestError>- The parsed HTTP response, or aRequestErroron failure.
Sourcepub async fn send_async(&mut self) -> Result<HttpResponse, RequestError>
pub async fn send_async(&mut self) -> Result<HttpResponse, RequestError>
Send the HTTP request asynchronously, returning the parsed response.
§Returns
Result<HttpResponse, RequestError>- The parsed HTTP response, or aRequestErroron failure.
Source§impl HttpRequest
Inherent implementation of HttpRequest.
impl HttpRequest
Inherent implementation of HttpRequest.
Sourcepub fn set_method(&mut self, method: Method) -> &mut Self
pub fn set_method(&mut self, method: Method) -> &mut Self
Sourcepub fn set_header<K, V>(&mut self, key: K, value: V) -> &mut Self
pub fn set_header<K, V>(&mut self, key: K, value: V) -> &mut Self
Sourcepub fn remove_header<K>(&mut self, key: K) -> &mut Self
pub fn remove_header<K>(&mut self, key: K) -> &mut Self
Sourcepub fn clear_headers(&mut self) -> &mut Self
pub fn clear_headers(&mut self) -> &mut Self
Sourcepub fn set_config(&mut self, config: RequestConfig) -> &mut Self
pub fn set_config(&mut self, config: RequestConfig) -> &mut Self
Source§impl HttpRequest
impl HttpRequest
Source§impl HttpRequest
impl HttpRequest
pub fn get_mut_headers(&mut self) -> &mut HashMap<String, String>
pub fn get_mut_config(&mut self) -> &mut RequestConfig
pub fn get_mut_tmp(&mut self) -> &mut Tmp
Trait Implementations§
Source§impl Clone for HttpRequest
impl Clone for HttpRequest
Source§impl Debug for HttpRequest
impl Debug for HttpRequest
Auto Trait Implementations§
impl Forget for HttpRequest
impl Freeze for HttpRequestwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<(String, String)>: Freeze,
PhantomData<(String, ())>: Freeze,
PhantomData<TrustAnchor<'static>>: Freeze,
impl Move for HttpRequest
impl RefUnwindSafe for HttpRequest
impl Send for HttpRequest
impl Sync for HttpRequest
impl Unpin for HttpRequest
impl UnsafeUnpin for HttpRequestwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<(String, String)>: UnsafeUnpin,
PhantomData<(String, ())>: UnsafeUnpin,
PhantomData<TrustAnchor<'static>>: UnsafeUnpin,
impl UnwindSafe for HttpRequestwhere
RawVecInner: UnwindSafe,
HashMap<String, String>: UnwindSafe,
NonNull<u8>: UnwindSafe,
&'static [u8]: UnwindSafe,
Blanket Implementations§
impl<T> AnySend for T
impl<T> AnySendClone for T
impl<T> AnySendSync for T
impl<T> AnySendSyncClone for T
impl<T> AnySync for T
impl<T> AnySyncClone for T
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