aliyun-openapi 0.3.0

Alibaba Cloud OpenAPI SDK for Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use serde::{Deserialize, Serialize};

#[derive(Serialize, Deserialize, Debug)]
pub struct HttpbinIp {
    origin: String,
}

#[tokio::test]
async fn test_http_get() -> Result<(), Box<dyn std::error::Error>> {
    let resp: HttpbinIp = reqwest::get("https://httpbin.org/ip")
        .await?
        .json()
        .await?;
    println!("IP: {}", resp.origin);
    Ok(())
}