summaryrefslogtreecommitdiff
path: root/ATRI/modules/response
diff options
context:
space:
mode:
[Update] Refactor this project
Diffstat (limited to 'ATRI/modules/response')
3 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
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
--- /dev/null
+++ b/ATRI/modules/response/__pycache__/__init__.cpython-37.pyc
Binary files 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
--- /dev/null
+++ b/ATRI/modules/response/__pycache__/__init__.cpython-38.pyc
Binary files differ