Trait asserhttp::AsserhttpHeader [−][src]
pub trait AsserhttpHeader<T> { fn expect_header<'a, K: Into<&'a str>, V: Into<&'a str>>(
&mut self,
key: K,
value: V
) -> &mut T; }
Expand description
For assertions on http response headers
Required methods
Expects response header to be equal
key
- expected header keyvalue
- expected header value
Example
use asserhttp::*; #[async_std::main] async fn main() { isahc::get("http://localhost").unwrap().expect_header("content-type", "application/json"); isahc::get("http://localhost").expect_header("content-type", "application/json"); isahc::get_async("http://localhost").await.unwrap().expect_header("content-type", "application/json"); isahc::get_async("http://localhost").await.expect_header("content-type", "application/json"); surf::get("http://localhost").await.unwrap().expect_header("content-type", "application/json"); surf::get("http://localhost").await.expect_header("content-type", "application/json"); }
Implementations on Foreign Types
fn expect_header<'a, K: Into<&'a str>, V: Into<&'a str>>(
&mut self,
key: K,
value: V
) -> &mut SurfResponse
[src]fn expect_header<'a, K: Into<&'a str>, V: Into<&'a str>>(
&mut self,
key: K,
value: V
) -> &mut SurfResponse
[src]fn expect_header<'a, K: Into<&'a str>, V: Into<&'a str>>(
&mut self,
key: K,
value: V
) -> &mut IsahcResponse<IsahcBody>
[src]fn expect_header<'a, K: Into<&'a str>, V: Into<&'a str>>(
&mut self,
key: K,
value: V
) -> &mut IsahcResponse<AsyncBody>
[src]fn expect_header<'a, K: Into<&'a str>, V: Into<&'a str>>(
&mut self,
key: K,
value: V
) -> &mut IsahcResponse<IsahcBody>
[src]impl AsserhttpHeader<Response<AsyncBody>> for Result<IsahcResponse<IsahcAsyncBody>, IsahcError>
[src]
impl AsserhttpHeader<Response<AsyncBody>> for Result<IsahcResponse<IsahcAsyncBody>, IsahcError>
[src]fn expect_header<'a, K: Into<&'a str>, V: Into<&'a str>>(
&mut self,
key: K,
value: V
) -> &mut IsahcResponse<AsyncBody>
[src]