first prototype
This commit is contained in:
20
scilog/utils.py
Normal file
20
scilog/utils.py
Normal file
@ -0,0 +1,20 @@
|
||||
import requests
|
||||
|
||||
|
||||
#TODO: add params/payload and response validation
|
||||
|
||||
|
||||
def get_request(url, params=None, headers=None, timeout=10):
|
||||
response = requests.get(url, params=params, headers=headers, timeout=timeout, verify=False).json()
|
||||
return response
|
||||
|
||||
def post_request(url, payload=None, headers=None, timeout=10):
|
||||
response = requests.post(url, json=payload, headers=headers, timeout=timeout, verify=False).json()
|
||||
return response
|
||||
|
||||
|
||||
def typename(obj):
|
||||
return type(obj).__name__
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user