Struct axum_test::TestRequest
source · pub struct TestRequest { /* private fields */ }Expand description
This contains the response from the server.
Inside are the contents of the response, the status code, and some debugging information.
You can get the contents out as it’s raw string, or deserialise it.
One can also also use the assert_* functions to test against the
response.
Implementations§
source§impl TestRequest
impl TestRequest
sourcepub fn expect_fail(self) -> Self
pub fn expect_fail(self) -> Self
Marks that this request should expect to fail. Failiure is deemend as any response that isn’t a 200.
By default, requests are expct to always succeed.
sourcepub fn json<J>(self, body: &J) -> Selfwhere
J: Serialize,
pub fn json<J>(self, body: &J) -> Selfwhere
J: Serialize,
Set the body of the request to send up as Json.
Trait Implementations§
source§impl Debug for TestRequest
impl Debug for TestRequest
source§impl IntoFuture for TestRequest
impl IntoFuture for TestRequest
§type Output = TestResponse
type Output = TestResponse
The output that the future will produce on completion.
§type IntoFuture = AutoFuture<TestResponse>
type IntoFuture = AutoFuture<TestResponse>
Which kind of future are we turning this into?
source§fn into_future(self) -> Self::IntoFuture
fn into_future(self) -> Self::IntoFuture
Creates a future from a value. Read more