romeotools/classes/http.py

11 lines
No EOL
349 B
Python

from urllib.request import Request, urlopen
from const import USER_AGENT, X_API_KEY
class HTTPRequest(Request):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.headers["User-Agent"] = USER_AGENT
self.headers["X-Api-Key"] = X_API_KEY
self.headers["Content-Type"] = "application/json"