Set session params instead of headers
This commit is contained in:
@@ -16,9 +16,10 @@ class FtCoinGeckoApi(CoinGeckoAPI):
|
|||||||
# Doint' pass api_key to parent, instead set the header on the session directly
|
# Doint' pass api_key to parent, instead set the header on the session directly
|
||||||
self._api_key = api_key
|
self._api_key = api_key
|
||||||
|
|
||||||
if api_key and not is_demo:
|
if api_key and is_demo:
|
||||||
self.api_base_url = self.__PRO_API_URL_BASE
|
# Use demo api key
|
||||||
self.session.headers.update({"x-cg-pro-api-key": api_key})
|
|
||||||
else:
|
|
||||||
self.api_base_url = self.__API_URL_BASE
|
self.api_base_url = self.__API_URL_BASE
|
||||||
self.session.headers.update({"x-cg-demo-api-key": api_key})
|
self.session.params.update({"x_cg_demo_api_key": api_key})
|
||||||
|
else:
|
||||||
|
self.api_base_url = self.__PRO_API_URL_BASE
|
||||||
|
self.session.params.update({"x_cg_pro_api_key": api_key})
|
||||||
|
|||||||
Reference in New Issue
Block a user