Struct finchers_test::ClientRequest
[−]
[src]
pub struct ClientRequest<'a, E: Endpoint + 'a> { /* fields omitted */ }
A builder of dummy HTTP request.
Methods
impl<'a, E: Endpoint> ClientRequest<'a, E>
[src]
pub fn method<M>(&mut self, method: M) -> &mut ClientRequest<'a, E> where
Method: HttpTryFrom<M>,
[src]
Method: HttpTryFrom<M>,
Overwrite the HTTP method of this dummy request with given value.
Panics
This method will panic if the parameter is invalid HTTP method.
pub fn uri<U>(&mut self, uri: U) -> &mut ClientRequest<'a, E> where
Uri: HttpTryFrom<U>,
[src]
Uri: HttpTryFrom<U>,
Overwrite the URI of this dummy request with given value.
Panics
This method will panic if the parameter is invalid HTTP method.
pub fn header<K, V>(&mut self, name: K, value: V) -> &mut ClientRequest<'a, E> where
HeaderName: HttpTryFrom<K>,
HeaderValue: HttpTryFrom<V>,
[src]
HeaderName: HttpTryFrom<K>,
HeaderValue: HttpTryFrom<V>,
Append the given header entry into this dummy request.
Panics
This method will panic if the given header name or value is invalid.
pub fn body(&mut self, body: RequestBody) -> &mut ClientRequest<'a, E>
[src]
Overwrite the message body of this dummy request with given instance.
pub fn run(&mut self) -> Result<E::Output, Error>
[src]
Apply this dummy request to the associated endpoint and get its response.