Struct ic_http_certification::http::HttpRequest
source · pub struct HttpRequest {
pub method: String,
pub url: String,
pub headers: Vec<HeaderField>,
pub body: Vec<u8>,
}
Expand description
A Candid-encodable representation of an HTTP request. This struct is used by canisters that implement the HTTP interface required by the HTTP Gateway Protocol.
Fields§
§method: String
HTTP request method.
url: String
Request URL.
headers: Vec<HeaderField>
HTTP request headers.
body: Vec<u8>
Request body as an array of bytes.
Implementations§
source§impl HttpRequest
impl HttpRequest
sourcepub fn get_path(&self) -> HttpCertificationResult<String>
pub fn get_path(&self) -> HttpCertificationResult<String>
Returns the path of the request URL, without domain, query parameters or fragments.
sourcepub fn get_query(&self) -> HttpCertificationResult<Option<String>>
pub fn get_query(&self) -> HttpCertificationResult<Option<String>>
Returns the query parameters of the request URL, if any, as a string.
Trait Implementations§
source§impl CandidType for HttpRequest
impl CandidType for HttpRequest
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<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
source§impl PartialEq for HttpRequest
impl PartialEq for HttpRequest
source§fn eq(&self, other: &HttpRequest) -> bool
fn eq(&self, other: &HttpRequest) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for HttpRequest
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