<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          rust 請(qǐng)求包reqwest實(shí)例

          共 923字,需瀏覽 2分鐘

           ·

          2023-12-06 23:00

          cargo.toml

          reqwest = { version = "0.11", features = ["json"] }
          serde = { version = "1.0", features = ["derive"] }
          serde_json = "1.0"
          tokio = { version = "1", features = ["full"] }


          main.rs

          use serde_json::{Value};
          use reqwest;
          use std::error::Error;
          use std::time::Duration;
          
          #[tokio::main]
          async fn main() -> Result<(), Box<dyn Error>> {
              let client = reqwest::Client::new();
              let doge = client
                  .get("https://datacenter.eastmoney.com/securities/api/data/v1/get?client=APP&filter=%28BOARD_CODE_BK%3D%22BK0815%22%29&reportName=RPT_CUSTOM_BOARD_TAG&source=SECURITIES")
                  .header("Accept", "text/plain")
                  .timeout(Duration::from_secs(3))
                  .send()
                  .await?
                  .text()
                  .await?;
              let parsed: Value = serde_json::from_str(&doge).unwrap();
              println!("{:}", parsed);
              println!("{:}", parsed["version"]);
              Ok(())
          }
          


          瀏覽 2
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          分享
          舉報(bào)
          評(píng)論
          圖片
          表情
          推薦
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          分享
          舉報(bào)
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  色图av | 欧美成人性生活在线视频打开 | 亚洲人爱免费视频 | 亚洲无码免费视频在线观看 | 黄色成人视频在线 |