pub struct TestClient { /* private fields */ }Expand description
A test client for sending HTTP requests to an Axum Router.
Implementations§
Source§impl TestClient
impl TestClient
Sourcepub async fn get(&self, uri: &str) -> TestResponse
pub async fn get(&self, uri: &str) -> TestResponse
Send a GET request to uri.
Sourcepub async fn post_json(&self, uri: &str, body: &str) -> TestResponse
pub async fn post_json(&self, uri: &str, body: &str) -> TestResponse
Send a POST request with a JSON body.
Sourcepub async fn put_json(&self, uri: &str, body: &str) -> TestResponse
pub async fn put_json(&self, uri: &str, body: &str) -> TestResponse
Send a PUT request with a JSON body.
Sourcepub async fn patch_json(&self, uri: &str, body: &str) -> TestResponse
pub async fn patch_json(&self, uri: &str, body: &str) -> TestResponse
Send a PATCH request with a JSON body.
Sourcepub async fn delete(&self, uri: &str) -> TestResponse
pub async fn delete(&self, uri: &str) -> TestResponse
Send a DELETE request.
Sourcepub async fn patch(&self, uri: &str) -> TestResponse
pub async fn patch(&self, uri: &str) -> TestResponse
Send a PATCH request.
Sourcepub async fn send(&self, request: Request<Body>) -> TestResponse
pub async fn send(&self, request: Request<Body>) -> TestResponse
Send a raw request.
Auto Trait Implementations§
impl !RefUnwindSafe for TestClient
impl !UnwindSafe for TestClient
impl Freeze for TestClient
impl Send for TestClient
impl Sync for TestClient
impl Unpin for TestClient
impl UnsafeUnpin for TestClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more