Created
May 17, 2016 23:43
-
-
Save jiaozhu/e920251cc382a32f50789aad8cfac46c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
def send_request(): | |
# My API | |
# POST https://passport.hupu.com/pc/login/member.action | |
try: | |
response = requests.post( | |
url="https://passport.hupu.com/pc/login/member.action", | |
params={ | |
"username": "killvoon", | |
"password": "fde0cdc18acca482ef4987591b07af26", | |
}, | |
headers={ | |
"Cookie": "_HUPUSSOID=500febd5-37aa-4961-b882-8f2d3160b87f; _HUPUSSOID=500febd5-37aa-4961-b882-8f2d3160b87f; _CLT=918ebe7bb324d8673460f7af1d701a5c; u=16804657|a2lsbHZvb24=|495b|e100cb27a1e3103e3df4f55e9fdb6230|a1e3103e3df4f55e|a2lsbHZvb24=; ua=25233240", | |
}, | |
) | |
print('Response HTTP Status Code: {status_code}'.format( | |
status_code=response.status_code)) | |
print('Response HTTP Response Body: {content}'.format( | |
content=response.content)) | |
except requests.exceptions.RequestException: | |
print('HTTP Request failed') | |
send_request() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment