Skip to navigation
Simple blocking get request with rust
30.09.22
[dependencies] reqwest = { version = "0.11.12", features = ["json","blocking"] } use reqwest; pub fn main()-> Result<(), Box
> { let res = reqwest::blocking::get("https://www.rust-lang.org/")?; let header = res.headers().clone(); let status = res.status().clone(); let body = res.text()?; println!("status: {}",status); println!("header: {:?}",header); println!("body: {:?}",body); Ok(()) }
https://camposha.info/rust/rust-reqwest/
Reply
Anonymous
Information Epoch 1732467509
Use software leverage to your advantage.
Home
Notebook
Contact us