pub struct HttpTask {
pub url: Option<String>,
pub method: Option<i32>,
pub headers: Vec<Header>,
pub body: Option<String>,
}
Expand description
The adapter will report the text body of a successful HTTP request to the specified url, or return an error if the response status code is greater than or equal to 400.
Input: None
Returns: String representation of the http response.
Example: Basic HttpTask
{"httpTask": {"url": "<https://mywebsite.org/path"}> }
Example: HttpTask example with headers
{ "httpTask": { "url": "<https://mywebsite.org/path",> "method": "METHOD_POST", "headers": [ { "key": "MY_HEADER_KEY", "value": "MY_HEADER_VALUE" } ], "body": "{\"MY_BODY_KEY\":\"MY_BODY_VALUE\"}" } }
Fields§
§url: Option<String>
/ A string containing the URL to direct this HTTP request to.
method: Option<i32>
/ The type of HTTP request to make.
headers: Vec<Header>
/ A list of headers to add to this HttpTask.
body: Option<String>
/ A stringified body (if any) to add to this HttpTask.
Implementations§
Trait Implementations§
Source§impl Message for HttpTask
impl Message for HttpTask
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Returns the encoded length of the message without a length delimiter.
Source§fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
Encodes the message to a buffer. Read more
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Encodes the message to a newly allocated buffer.
Source§fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
Encodes the message with a length-delimiter to a buffer. Read more
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Encodes the message with a length-delimiter to a newly allocated buffer.
Source§fn decode<B>(buf: B) -> Result<Self, DecodeError>
fn decode<B>(buf: B) -> Result<Self, DecodeError>
Decodes an instance of the message from a buffer. Read more
Source§fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
Decodes a length-delimited instance of the message from the buffer.
Source§fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
Decodes an instance of the message from a buffer, and merges it into
self
. Read moreSource§fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
Decodes a length-delimited instance of the message from buffer, and
merges it into
self
.impl StructuralPartialEq for HttpTask
Auto Trait Implementations§
impl Freeze for HttpTask
impl RefUnwindSafe for HttpTask
impl Send for HttpTask
impl Sync for HttpTask
impl Unpin for HttpTask
impl UnwindSafe for HttpTask
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