mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-02-18 22:23:56 +08:00
14 lines
382 B
Python
14 lines
382 B
Python
import requests
|
|
|
|
def api_get(endpoint, method='GET', timeout=None, access_token=None, **params):
|
|
backend = "https://api.commadotai.com/"
|
|
|
|
params['_version'] = "OPENPILOTv0.3"
|
|
|
|
headers = {}
|
|
if access_token is not None:
|
|
headers['Authorization'] = "JWT "+access_token
|
|
|
|
return requests.request(method, backend+endpoint, timeout=timeout, headers = headers, params=params)
|
|
|