1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| import requests import json
headers = { 'Accept': 'application/json, text/plain, */*', 'Content-Type': 'application/json;charset=UTF-8', 'Origin': 'xxx', 'Referer': 'xxx', 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36', 'cookie': 'xxx' }
url = 'http://www.xxx.com/api/xxx' data = { 'id': '10001', 'token': "xxxxxx" } res = requests.post(url, data=json.dumps(data), headers=headers) print('res: ', res)
|