Skip to main content

request

Function request 

Source
pub async fn request(
    router: &Router,
    method: Method,
    path: &str,
    json: Option<&str>,
) -> TestResponse
Expand description

Sends a request through the router without a network. json (when Some) becomes a JSON body with content-type: application/json.

ยงPanics

Panics when the router itself fails (never for ordinary responses).