My URL the following:
“https://fapi.binance.com/fapi/v1/openOrders?timestamp=1712840260000&signature=c4945231644bd4f31fa0747ccf85b5c488d3697e402883814dcf1a4e0c3c2c0c”
Everytime I got this :
{StatusCode: 400, ReasonPhrase: ‘Bad Request’, Version: 1.1, Content: System.Net.Http.StreamContent, Headers:
{
Connection: keep-alive
x-mbx-used-weight-1m: 61
x-response-time: 0ms
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
Date: Thu, 11 Apr 2024 12:57:32 GMT
Server: Tengine
Content-Length: 88
Content-Type: application/json
}}
What I do wrong?
My method:
public async void OrderStatus(string symbol = "btcusdt")
{
//string depthEndpoint = $"https://fapi.binance.com/fapi/v1/openOrders";
string endpoint = "/fapi/v1/openOrders";
string timestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds().ToString();
string queryString = $"timestamp={timestamp}";
string signature = GenerateSignature(queryString, BinanceOptionsApp.Models.Credential.Sec);
string requestUrl = $"https://fapi.binance.com{endpoint}?{queryString}&signature={signature}";
var path = new Uri(requestUrl);
HttpResponseMessage response = await _httpClient.GetAsync(path);
if (response.IsSuccessStatusCode)
{
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadAsStringAsync().ConfigureAwait(false);
}
}