mirror of
https://github.com/logos-blockchain/logos-blockchain-block-explorer-template.git
synced 2026-01-02 13:13:10 +00:00
12 lines
362 B
Python
12 lines
362 B
Python
|
|
import requests
|
||
|
|
from rusty_results import Option
|
||
|
|
|
||
|
|
from core.authentication import Authentication
|
||
|
|
|
||
|
|
|
||
|
|
def get(url, params=None, auth: Option[Authentication] = None, **kwargs):
|
||
|
|
headers = kwargs.get("headers", {})
|
||
|
|
if auth.is_some:
|
||
|
|
headers["Authorization"] = auth.unwrap().for_requests()
|
||
|
|
return requests.get(url, params, headers=headers, **kwargs)
|