Skip to navigation
Serde_json a awc couhdb result
07.12.22
let client = Client::new(); let _res = client.get("http://foo.com/gms/low_margin_order2") .insert_header(("User-Agent", "Actix-web")) .insert_header(("Authorization", "Basic xxx")) .send() .await; let _bin = _res.unwrap().body().await.unwrap(); let _s = str::from_utf8(&_bin).unwrap(); let mut v: Value = serde_json::from_str(_s).unwrap(); v["unixdate"] = _time.to_string().into(); println!("{:?}",v["unixdate"]); let str = serde_json::to_string(&v).unwrap(); println!("{:?}",str); let res = client.post("http://foo.com/gms/low_margin_order2") .insert_header(("User-Agent", "Actix-web")) .insert_header(("Authorization", "Basic xxx")) .send_json(&v).await; println!("json {:?}", res);
https://docs.rs/awc/latest/awc/
Reply
Anonymous
Information Epoch 1742398601
Design for simplicity, add complexity only where you must.
Home
Notebook
Contact us