Logo
Explore Help
Sign In
zsh/scwrypts
1
0
Fork 0
You've already forked scwrypts
Code Issues Pull Requests Packages Projects Releases Wiki Activity
Files
e0cbf58b3c2a39535d00fbeef5f27434fa9c4814
scwrypts/py/lib/http/client.py

21 lines
529 B
Python
Raw Normal View History

v2.8.0 ===================================================================== --- Changes ------------------------------ - python library functions moved to `py/lib` - python scwrypts renamed in kebob-case to help prevent import - __name__ == '__main__' enforced on all python scwrypts --- New Features ------------------------- - `__override` variables now allow values to be force-overwritten - py.lib.http.client provides a slim `requests.request` wrapper --- New Scripts -------------------------- py/data/convert ) quick data converters - csv-to-json - csv-to-yaml - json-to-csv - json-to-yaml - yaml-to-csv - yaml-to-json py/linear ) uses the linear.app graphql API for PM tasks - comment --- Bug Fixes ---------------------------- - `scwrypts` handles arguments with quotes and special characters
2023-01-11 17:09:59 -07:00
from requests import request
def get_request_client(base_url, headers=None):
if headers is None:
headers = {}
return lambda method, endpoint, **kwargs: request(
method = method,
url = f'{base_url}/{endpoint}',
headers = {
**headers,
**kwargs.get('headers', {}),
},
**{
key: value
for key, value in kwargs.items()
if key != 'headers'
},
)
Reference in New Issue Copy Permalink
© 2020-2025 Wryn (yage) Wagner