fetch_json

Function fetch_json 

Source
pub async fn fetch_json(url: &str) -> Result<Value>
Expand description

流式下载 JSON 文件

使用 reqwest 的 stream 特性流式下载 JSON 文件,支持 gzip 和 brotli 压缩

§参数

  • url - 要下载的 URL

§返回

解析后的 JSON Value

§示例

let json = fetch_json("https://openmd.shinnytech.com/t/md/symbols/latest.json").await?;