mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-28 21:12:16 +00:00
headers function wasnt being called, just referenced
This commit is contained in:
@@ -36,7 +36,7 @@ def get_stocks_data():
|
||||
provider = random.choice(["fmp", "intrinio", "polygon", "yfinance"]) # noqa: S311
|
||||
|
||||
data["stocks_data"] = get_data(
|
||||
"stocks", symbol=symbol, provider=provider, headers=headers
|
||||
"stocks", symbol=symbol, provider=provider, headers=headers()
|
||||
)
|
||||
return data["stocks_data"]
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ def get_data(menu: str, symbol: str, provider: str, headers):
|
||||
"""Randomly pick a symbol and a provider and get data from the selected menu."""
|
||||
|
||||
url = f"http://0.0.0.0:8000/api/v1/{menu}/load?symbol={symbol}&provider={provider}"
|
||||
result = requests.get(url, headers=headers, timeout=10)
|
||||
result = requests.get(url, headers=headers(), timeout=10)
|
||||
return result.json()["results"]
|
||||
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ def get_data(menu: str, symbol: str, provider: str, headers):
|
||||
"""Randomly pick a symbol and a provider and get data from the selected menu."""
|
||||
|
||||
url = f"http://0.0.0.0:8000/api/v1/{menu}/load?symbol={symbol}&provider={provider}"
|
||||
result = requests.get(url, headers=headers, timeout=10)
|
||||
result = requests.get(url, headers=headers(), timeout=10)
|
||||
return result.json()["results"]
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user