Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lz1998/esp-minreq
Async HTTP Client
https://github.com/lz1998/esp-minreq
async client esp esp32 http minreq rust
Last synced: 19 days ago
JSON representation
Async HTTP Client
- Host: GitHub
- URL: https://github.com/lz1998/esp-minreq
- Owner: lz1998
- Created: 2023-11-25T07:05:41.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-11-29T15:51:55.000Z (about 1 year ago)
- Last Synced: 2024-11-23T10:15:30.127Z (3 months ago)
- Topics: async, client, esp, esp32, http, minreq, rust
- Language: Rust
- Homepage:
- Size: 46.9 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# esp-minreq
Async HTTP Client```toml
esp-minreq = { git = "https://github.com/lz1998/esp-minreq.git", branch = "main", features = ["json"] }
``````rust
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Default, Debug)]
#[serde(default)]
struct Response {
pub ip: String,
pub ip_decimal: i64,
pub country: String,
pub country_iso: String,
pub country_eu: bool,
pub region_name: String,
pub region_code: String,
pub city: String,
pub latitude: f64,
pub longitude: f64,
pub time_zone: String,
pub asn: String,
pub asn_org: String,
}
let resp: Response = esp_minreq::get("https://ifconfig.co/json")
.send::()
.await
.unwrap()
.json()
.unwrap();
log::info!("{:?}", resp);
```