Struct fiberplane_models::providers::HttpRequest
source · #[non_exhaustive]pub struct HttpRequest {
pub url: String,
pub method: HttpRequestMethod,
pub headers: Option<BTreeMap<String, String>>,
pub body: Option<Bytes>,
}Expand description
HTTP request options.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.url: String§method: HttpRequestMethod§headers: Option<BTreeMap<String, String>>§body: Option<Bytes>Implementations§
source§impl HttpRequest
impl HttpRequest
sourcepub fn post(url: impl Into<String>, body: impl Into<Bytes>) -> Self
pub fn post(url: impl Into<String>, body: impl Into<Bytes>) -> Self
Returns a new POST request to the given URL with the given body.
sourcepub fn patch(url: impl Into<String>, body: impl Into<Bytes>) -> Self
pub fn patch(url: impl Into<String>, body: impl Into<Bytes>) -> Self
Returns a new PATCH request to the given URL with the given body.
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 Default for HttpRequest
impl Default for HttpRequest
source§fn default() -> HttpRequest
fn default() -> HttpRequest
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for HttpRequest
impl<'de> Deserialize<'de> for HttpRequest
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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