Struct extism_pdk::HttpRequest
source · pub struct HttpRequest {
pub url: String,
pub headers: BTreeMap<String, String>,
pub method: Option<String>,
}
Expand description
HTTP request type Generic HTTP request structure
Fields§
§url: String
The request URL
headers: BTreeMap<String, String>
Request headers
method: Option<String>
Request method
Implementations§
source§impl HttpRequest
impl HttpRequest
sourcepub fn new(url: impl Into<String>) -> HttpRequest
pub fn new(url: impl Into<String>) -> HttpRequest
Create a new HttpRequest
to the given URL
sourcepub fn with_method(self, method: impl Into<String>) -> HttpRequest
pub fn with_method(self, method: impl Into<String>) -> HttpRequest
Update the method
sourcepub fn with_header(
self,
key: impl Into<String>,
value: impl Into<String>,
) -> HttpRequest
pub fn with_header( self, key: impl Into<String>, value: impl Into<String>, ) -> HttpRequest
Add a header
Trait Implementations§
source§impl Clone for HttpRequest
impl Clone for HttpRequest
source§fn clone(&self) -> HttpRequest
fn clone(&self) -> HttpRequest
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for HttpRequest
impl Debug for HttpRequest
source§impl<'de> Deserialize<'de> for HttpRequest
impl<'de> Deserialize<'de> for HttpRequest
source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<HttpRequest, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<HttpRequest, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq for HttpRequest
impl PartialEq for HttpRequest
source§impl Serialize for HttpRequest
impl Serialize for HttpRequest
source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for HttpRequest
Auto Trait Implementations§
impl Freeze for HttpRequest
impl RefUnwindSafe for HttpRequest
impl Send for HttpRequest
impl Sync for HttpRequest
impl Unpin for HttpRequest
impl UnwindSafe for HttpRequest
Blanket Implementations§
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)