Hello, i'm not able to get the btc/usdt marketprice while on Ubuntu 18.04 or linux based system. It's fine when i run it on macos, but on linux, failed with 451, and after i look at the log, it shows a little different with macos.
On linux:
ureq::response: Body entirely buffered (length: 224)
and on macos:
ureq::response: Body entirely buffered (length: 45)
Here is my codes:
use binance_spot_connector_rust::market;
use binance_spot_connector_rust::ureq::BinanceHttpClient;
use anyhow:Result;
#[derive(Default, Debug, Clone)]
struct BtcToUsdt {
symbol: String,
price: String,
}
#[tokio::main]
async fn main() -> Result<()> {
let client = BinanceHttpClient::default();
let request = market::ticker_price().symbol("BTCUSDT");
let data = match client.send(request) {
Ok(data) => match data.into_body_str() {
Ok(d) => d,
Err(_e) => return Err(CustomError("btc_price body is error".to_string())),
},
Err(_e) => return Err(CustomError("btc price request is error".to_string())),
};
let data: BtcToUsdt = serde_json::from_str(&data)?;
println!("{data:#?}");
Ok()
}
The question is, how can make it properly on linux?
Hello, i'm not able to get the btc/usdt marketprice while on Ubuntu 18.04 or linux based system. It's fine when i run it on macos, but on linux, failed with 451, and after i look at the log, it shows a little different with macos.
On linux:
and on macos:
Here is my codes:
The question is, how can make it properly on linux?