Skip to content

Added ability to set headers on statsapi.game() requests #629

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jun 29, 2025

Conversation

tracerrx
Copy link
Contributor

Added data.headers with a constant API HEADERS. Updated the statsapi.game() requests in

data/dates.py
data/game.py
data/standings.py
data/teams.py
data/unifiorms.py

Need Brian Ward to take a look at the main game.py requests and replace his testing_params

I'm honestly not sure how to test that were actually sending the correct headers

@WardBrian
Copy link
Member

WardBrian commented Jun 27, 2025

For the testing params, you should be able to leave them with just | after the params, like

live_data = statsapi.get("game", {"gamePk": self.game_id, "fields": API_FIELDS} | testing_params , data.headers.API_HEADERS)

@tracerrx
Copy link
Contributor Author

There are also some headers specified in headlines.py that are hard coded and not part of the mlb api request.

@ty-porter ty-porter merged commit cbdb271 into MLB-LED-Scoreboard:dev Jun 29, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants