~nhanb/gae-proxy

ref: 31bc73d215131139276771f09854021eb89cba00 gae-proxy/send.py -rw-r--r-- 473 bytes
31bc73d2Bùi Thành Nhân testing 2 years ago
                                                                                
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
import os

import requests

"""
Lazy quick test script
"""

PASSWORD = os.environ["GAEPROXY_PASSWORD"]


resp = requests.post(
    "https://nhansproxy.df.r.appspot.com/proxy",
    json={
        "url": "https://httpbin.org/ip",
        "method": "get",
        "body": None,
        "headers": {"Foo-Bar": "ehhhh"},
        "password": PASSWORD,
    },
)

"""
print(resp.status_code)
for hkey, hval in resp.headers.items():
    print(hkey, ":", hval)
"""

print(resp.text)