[][src]Struct automaat_processor_http_request::HttpRequest

pub struct HttpRequest {
    pub url: Url,
    pub method: Method,
    pub headers: Vec<Header>,
    pub body: Option<String>,
    pub assert_status: Vec<i32>,
}

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]

impl Clone for 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]

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]

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]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> Erased for T

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Err = <U as TryFrom<T>>::Err