Skip to content

Commit

Permalink
Merge pull request #133 from 4t145/broadcast-arc-in-websocket
Browse files Browse the repository at this point in the history
support delete with body
  • Loading branch information
4t145 authored Jun 19, 2024
2 parents 00893fa + 0949085 commit 9e02713
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tardis/src/web/web_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,17 @@ impl TardisWebClient {
self.to_json::<T>(code, headers, response).await
}

/// Delete and parse response body as json with a body
pub async fn delete_with_body<T: for<'de> Deserialize<'de>, B: Serialize>(
&self,
url: impl IntoUrl,
headers: impl IntoIterator<Item = (String, String)>,
body: &B,
) -> TardisResult<TardisHttpResponse<T>> {
let (code, headers, response) = self.request(Method::DELETE, url, headers, Json(body)).await?;
self.to_json::<T>(code, headers, response).await
}

/// Post and ignore response body
pub async fn post_str_to_str(
&self,
Expand Down

0 comments on commit 9e02713

Please sign in to comment.