Skip to content
This repository has been archived by the owner on Jun 7, 2024. It is now read-only.

Commit

Permalink
Bump version to 0.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
iawia002 committed May 20, 2024
1 parent ebea612 commit 4bcc958
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "wasi-http-client"
description = "HTTP client library for WASI"
readme = "README.md"
version = "0.2.0"
version = "0.2.1"
edition = "2021"
authors = ["Xinzhao Xu"]
categories = ["wasm"]
Expand Down
17 changes: 17 additions & 0 deletions src/response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,23 @@ impl Response {
/// # Optional
///
/// This requires the `json` feature enabled.
///
/// ```
/// # use anyhow::Result;
/// # use serde::Deserialize;
/// # use wasi_http_client::Client;
/// # fn run() -> Result<()> {
/// #[derive(Deserialize)]
/// struct Data {
/// origin: String,
/// url: String,
/// }
///
/// let resp = Client::new().get("https://httpbin.org/get").send()?;
/// let json_data = resp.json::<Data>()?;
/// # Ok(())
/// # }
/// ```
#[cfg(feature = "json")]
#[cfg_attr(docsrs, doc(cfg(feature = "json")))]
pub fn json<T: DeserializeOwned>(self) -> Result<T> {
Expand Down

0 comments on commit 4bcc958

Please sign in to comment.