Skip to content

Commit

Permalink
Specify http agent header
Browse files Browse the repository at this point in the history
  • Loading branch information
booxter committed Jul 6, 2024
1 parent a7c0fca commit e8683c2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/letsrolld/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@

_CACHE_INSTALLED = False

# TODO: use a library to fill these in
_HEADERS = {
"Content-Type": "application/json",
"User-Agent": "PostmanRuntime/7.39.0",
}


# stolen from stackoverflow
def enable_debug():
Expand All @@ -24,4 +30,4 @@ def get_url(url):


def get_json(url, json):
return requests.post(url, json=json).json()
return requests.post(url, headers=_HEADERS, json=json)

0 comments on commit e8683c2

Please sign in to comment.