pub async fn post<T: DeserializeOwned, U: Serialize>(
        &self,
        path: impl AsRef<str>,
        body: U,
    ) -> Result<T> {
        let response = self.0.post(Self::make_url(path)).json(&body).send().await?;

        if !response.status().is_success() {
            return Err(Error::UnsuccessfulRequest(response));
        }

        let body = response.json().await?;

        Ok(body)
    }
/// Make a `POST` request to the API with a json body and convert the response body to json.
Make a `POST` request to the API with a json body and convert the response body to json.
Make a ` POST ` request to the API with a json body and convert the response body to json .
pub async fn post<T: DeserializeOwned, U: Serialize>(
        &self,
        path: impl AsRef<str>,
        body: U,
    ) -> Result<T> {
        let response = self.0.post(Self::make_url(path)).json(&body).send().await?;
        if !response.status().is_success() {
            return Err(Error::UnsuccessfulRequest(response));
        }
        let body = response.json().await?;
        Ok(body)
    }
pub async fn post < T : DeserializeOwned , U : Serialize > ( & self , path : impl AsRef < str > , body : U , ) -> Result < T > { let response = self . 0 . post ( Self :: make_url ( path ) ) . json ( & body ) . send ( ) . await ? ; if ! response . status ( ) . is_success ( ) { return Err ( Error :: UnsuccessfulRequest ( response ) ) ; } let body = response . json ( ) . await ? ; Ok ( body ) }
Make a `POST` request to the API with a json body and convert the response body to json.
Make a ` POST ` request to the API with a json body and convert the response body to json .
&self
path
impl AsRef<str>
body
U
&self
path
impl AsRef<str>
body
U