~nhanb/gae-proxy

ref: 81a6366cce5826733624b95e5c80a36cf86f0db7 gae-proxy/send.py -rw-r--r-- 493 bytes
81a6366cBùi Thành Nhân add README 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
import os

import requests

"""
Lazy quick test script
"""

PASSWORD = os.environ.get("GAEPROXY_PASSWORD", "foo")
print(PASSWORD)


resp = requests.post(
    "https://nhansproxy.df.r.appspot.com/proxy",
    json={
        "url": "https://httpbin.org/get",
        "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)