From cec3a97227dd3f9a88bbafe7f2bc96bf513f53ae Mon Sep 17 00:00:00 2001 From: Kyomotoi <1172294279@qq.com> Date: Sun, 2 Aug 2020 00:29:45 +0800 Subject: [Update] Refactor this project --- ATRI/modules/response/__init__.py | 19 +++++++++++++++++++ .../response/__pycache__/__init__.cpython-37.pyc | Bin 0 -> 531 bytes .../response/__pycache__/__init__.cpython-38.pyc | Bin 0 -> 858 bytes 3 files changed, 19 insertions(+) create mode 100644 ATRI/modules/response/__init__.py create mode 100644 ATRI/modules/response/__pycache__/__init__.cpython-37.pyc create mode 100644 ATRI/modules/response/__pycache__/__init__.cpython-38.pyc (limited to 'ATRI/modules/response') 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 diff --git a/ATRI/modules/response/__pycache__/__init__.cpython-37.pyc b/ATRI/modules/response/__pycache__/__init__.cpython-37.pyc new file mode 100644 index 0000000..c5598a0 Binary files /dev/null and b/ATRI/modules/response/__pycache__/__init__.cpython-37.pyc differ diff --git a/ATRI/modules/response/__pycache__/__init__.cpython-38.pyc b/ATRI/modules/response/__pycache__/__init__.cpython-38.pyc new file mode 100644 index 0000000..692ea38 Binary files /dev/null and b/ATRI/modules/response/__pycache__/__init__.cpython-38.pyc differ -- cgit v1.2.3