pub struct CanisterHttpRequestArgument {
pub url: String,
pub max_response_bytes: Option<u64>,
pub method: HttpMethod,
pub headers: Vec<HttpHeader>,
pub body: Option<Vec<u8>>,
pub transform: Option<TransformContext>,
}
Expand description
Argument type of super::http_request.
Fields§
§url: String
The requested URL.
max_response_bytes: Option<u64>
The maximal size of the response in bytes. If None, 2MiB will be the limit. This value affects the cost of the http request and it is highly recommended to set it as low as possible to avoid unnecessary extra costs. See also the pricing section of HTTP outcalls documentation.
method: HttpMethod
The method of HTTP request.
headers: Vec<HttpHeader>
List of HTTP request headers and their corresponding values.
body: Option<Vec<u8>>
Optionally provide request body.
transform: Option<TransformContext>
Name of the transform function which is func (transform_args) -> (http_response) query
.
Set to None
if you are using http_request_with
or http_request_with_cycles_with
.
Trait Implementations§
Source§impl Clone for CanisterHttpRequestArgument
impl Clone for CanisterHttpRequestArgument
Source§fn clone(&self) -> CanisterHttpRequestArgument
fn clone(&self) -> CanisterHttpRequestArgument
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 CanisterHttpRequestArgument
impl Debug for CanisterHttpRequestArgument
Source§impl Default for CanisterHttpRequestArgument
impl Default for CanisterHttpRequestArgument
Source§fn default() -> CanisterHttpRequestArgument
fn default() -> CanisterHttpRequestArgument
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for CanisterHttpRequestArgument
impl<'de> Deserialize<'de> for CanisterHttpRequestArgument
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
impl Eq for CanisterHttpRequestArgument
impl StructuralPartialEq for CanisterHttpRequestArgument
Auto Trait Implementations§
impl Freeze for CanisterHttpRequestArgument
impl RefUnwindSafe for CanisterHttpRequestArgument
impl Send for CanisterHttpRequestArgument
impl Sync for CanisterHttpRequestArgument
impl Unpin for CanisterHttpRequestArgument
impl UnwindSafe for CanisterHttpRequestArgument
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)