You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For the past few months using the default implementations of the clients in this library has resulted in HTTP status codes of 403. The reason is that CoinGecko now require a user agent specified in the requests.
This library already provides the fix built in you just have to use it!
If we look at the BaseAPIClient in the library we see this at line 43:
Each client in this library provides the ability to pass in your own instance of System.Net.HttpClient which is great because you can make one and set a DefaultRequestHeader of User-Agent.
So for example:
//Create an instance of System.Net.HttpClient and add our request header
HttpClient hClient = new HttpClient();
hClient.DefaultRequestHeaders.Add("User-Agent","myApp or whatever");
//Pass our HttpClient instance to the CoinCecko client
ICoinGeckoClient cgClient = new CoinGeckoClient(hClient);
Hopefully this helps anyone getting this problem.
The text was updated successfully, but these errors were encountered:
For the past few months using the default implementations of the clients in this library has resulted in HTTP status codes of 403. The reason is that CoinGecko now require a user agent specified in the requests.
This library already provides the fix built in you just have to use it!
If we look at the BaseAPIClient in the library we see this at line 43:
Each client in this library provides the ability to pass in your own instance of System.Net.HttpClient which is great because you can make one and set a DefaultRequestHeader of User-Agent.
So for example:
Hopefully this helps anyone getting this problem.
The text was updated successfully, but these errors were encountered: