diff options
Diffstat (limited to 'ATRI/modules/response/__init__.py')
-rw-r--r-- | ATRI/modules/response/__init__.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/ATRI/modules/response/__init__.py b/ATRI/modules/response/__init__.py new file mode 100644 index 0000000..4a47140 --- /dev/null +++ b/ATRI/modules/response/__init__.py @@ -0,0 +1,19 @@ +# -*- coding:utf-8 -*- +import requests +from aiohttp import ClientSession + +def request_api(url): + response = requests.request("GET", url) + html = response.text + return html + +def request_api_params(url, params): + response = requests.get(url, params = params) + html = response.text + return html + +async def post_bytes(url, headers=None,data=None): + async with ClientSession() as asyncsession: + async with asyncsession.post(url,headers=headers,data=data) as response: + b = await response.read() + return b
\ No newline at end of file |