Function http_typed::send_custom

source ·
pub async fn send_custom<Req, Res>(
    url: &str,
    method: HttpMethod,
    request: Req
) -> Result<Res, Error<Req::Error>>where
    Req: SimpleBody,
    Res: for<'a> Deserialize<'a>,
Expand description

Convenience function to create a client and send a request using minimal boilerplate. Creating a client is expensive, so you should not use this function if you plan on sending multiple requests.

Equivalent to:

  • Client::default().send_custom(url, method, request)
  • Client::new(url).send_custom("", method, request)

Send the provided request to the specified url using the specified method, and deserialize the response into the specified response type.