-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.py
46 lines (35 loc) · 1.18 KB
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import asyncio
from proxy_www import www, http, https, POST, GET
async def test():
async def async_test():
print('async call')
resp = await www.github.com
print(resp)
async def async_secure_test():
print('secure in async call')
req: www = www.github.com.secure()
print('Request :', req)
print('Is secure? :', req.is_secure)
print(await req)
async def div_test():
http_member_req = http.www.github.com
print(http_member_req)
print(await http_member_req)
div_path_req = www.github.com/'profile'
print(div_path_req)
print(await div_path_req)
def sync_test():
print('sync call')
resp = www.github.com()
print(resp)
async def https_test():
resp = await https.github.com
print(resp)
async def method_with_params():
# https://api.koreanbots.dev/v1
resp = await (https.api.koreanbots.dev / 'v1/bots/get/541645954256863252')[GET](
headers={"content-type": "application/json"}
)
print(await resp.json())
await method_with_params()
asyncio.get_event_loop().run_until_complete(test())