Fix RunPod API client requests
This commit is contained in:
parent
bd92baeb46
commit
49a9d0d1a1
1 changed files with 1 additions and 0 deletions
|
|
@ -27,6 +27,7 @@ def request(method: str, path: str, body=None, query=None):
|
||||||
url += "?" + urllib.parse.urlencode(query)
|
url += "?" + urllib.parse.urlencode(query)
|
||||||
data = None if body is None else json.dumps(body).encode("utf-8")
|
data = None if body is None else json.dumps(body).encode("utf-8")
|
||||||
call = urllib.request.Request(url, data=data, method=method)
|
call = urllib.request.Request(url, data=data, method=method)
|
||||||
|
call.add_header("User-Agent", "h3-blackwell-runtime/0.1")
|
||||||
call.add_header("Authorization", f"Bearer {key}")
|
call.add_header("Authorization", f"Bearer {key}")
|
||||||
call.add_header("Accept", "application/json")
|
call.add_header("Accept", "application/json")
|
||||||
if data is not None:
|
if data is not None:
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue