pub struct TestClient { /* private fields */ }Expand description
Test HTTP client for making requests to the application
Implementations§
Source§impl TestClient
impl TestClient
Sourcepub async fn get(&self, path: &str) -> TestResponse
pub async fn get(&self, path: &str) -> TestResponse
Make a GET request
Sourcepub async fn delete(&self, path: &str) -> TestResponse
pub async fn delete(&self, path: &str) -> TestResponse
Make a DELETE request
Sourcepub async fn query(&self, path: &str, body: Vec<u8>) -> TestResponse
pub async fn query(&self, path: &str, body: Vec<u8>) -> TestResponse
Make a QUERY request (safe query with a request body, draft-ietf-httpbis-safe-method-w-body)
Sourcepub async fn request(
&self,
method: HttpMethod,
path: &str,
body: Option<Vec<u8>>,
) -> TestResponse
pub async fn request( &self, method: HttpMethod, path: &str, body: Option<Vec<u8>>, ) -> TestResponse
Make a request with custom method
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<R, D> DepsPresent<D> for R
Source§impl<T> Injectable for T
impl<T> Injectable for T
Source§fn type_id_of() -> TypeIdwhere
Self: Sized,
fn type_id_of() -> TypeIdwhere
Self: Sized,
Returns the TypeId of this type (for internal use)
Source§fn type_name_of() -> &'static strwhere
Self: Sized,
fn type_name_of() -> &'static strwhere
Self: Sized,
Returns the type name for debugging