JKorf / Binance.Net

A C# .netstandard client library for the Binance REST and Websocket Spot and Futures API focusing on clear usage and models
https://jkorf.github.io/Binance.Net/
MIT License
1.04k stars 427 forks source link

binanceRestClient.SpotApi.ExchangeData.GetProductsAsync() is not working #1381

Closed artastakenaka closed 3 months ago

artastakenaka commented 4 months ago

Describe the bug binanceRestClient.SpotApi.ExchangeData.GetProductsAsync() is not working

To Reproduce var binanceRestClient = new BinanceRestClient(); var response = await binanceRestClient.SpotApi.ExchangeData.GetProductsAsync();

Debug logging image

JKorf commented 3 months ago

Binance seems to have added GZip compression to the endpoint. I'll add a fix for this in next version. Until that time you can provide a httpclient to the BinanceRestClient to fix it:

var handler = new HttpClientHandler();
handler.AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate;
var httpClient = new HttpClient(handler);
var client = new BinanceRestClient(httpClient, fac);
JKorf commented 3 months ago

Fixed in the latest version