I'm trying to write a rust program that interfaces with Binance's REST API. The link to the documentation is here. The problem is that I'm sending a POST request with reqwest, a rust crate, but simply receive {"code":-2015,"msg":"Invalid API-key, IP, or permissions for action."}
as the response. The body's supposed to be empty, as per the documentation.
let final_url = "https://api.binance.com/api/v3/userDataStream".to_string();
let client = reqwest::blocking::Client::new();
let response: Value = client.post(&final_url)
.body("")
.header("X-MBX-APIKEY", api_key)
.send().unwrap()
.json().unwrap();
println!("response: {}", response);
api_key in this case is just a string containing the key(which I'm sure is correct, but who knows). I've done everything from creating new API keys to just trying the secret key instead of the API key, but nothing's been giving.