[−][src]Struct automaat_processor_http_request::HttpRequest
The processor configuration.
Fields
url: Url
The URL to make the request to.
method: Method
The HTTP method (GET, POST, etc.) to use.
headers: Vec<Header>
An optional set of headers to add to the request.
body: Option<String>
The optional body of the request.
assert_status: Vec<i32>
An assertion to validate the status code of the response matches one of the provided values.
Trait Implementations
impl Eq for HttpRequest
[src]
impl PartialEq<HttpRequest> for HttpRequest
[src]
fn eq(&self, other: &HttpRequest) -> bool
[src]
fn ne(&self, other: &HttpRequest) -> bool
[src]
impl Clone for HttpRequest
[src]
fn clone(&self) -> HttpRequest
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for HttpRequest
[src]
impl<'a> Processor<'a> for HttpRequest
[src]
const NAME: &'static str
[src]
type Error = Error
If a processor fails its intended purpose, the returned error is turned into a string, and shown in the automaat-web-client
application. Read more
type Output = String
The processor can return any (successful) output it wants, as long as that type implements the [std::fmt::Display
] trait. Read more
fn validate(&self) -> Result<(), Self::Error>
[src]
Validate the HttpRequest
configuration.
Errors
This method returns an error if one of the provided HTTP headers has an invalid format.
fn run(&self, _context: &Context) -> Result<Option<Self::Output>, Self::Error>
[src]
Do the configured HTTP request, and return its results.
Output
If the request was successful, and the response status matches the optional status assertion, the body of the response is returned.
If the body is an empty string, None
is returned instead.
Errors
If the provided HTTP headers are invalid, the Error::Header
error
variant is returned.
If the request fails, or the response body cannot be read, the
Error::Response
error variant is returned.
If the response status does not match one of the provided status
assertions, the Error::Status
error variant is returned.
impl<'de> Deserialize<'de> for HttpRequest
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Serialize for HttpRequest
[src]
Auto Trait Implementations
impl Send for HttpRequest
impl Sync for HttpRequest
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
fn equivalent(&self, key: &K) -> bool
[src]
impl<T> Erased for T
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
U: TryFrom<T>,