-----------------------------7e713d354f0fa6 Content-Disposition: form-data; name="username" log_username -----------------------------7e713d354f0fa6 Content-Disposition: form-data; name="password" log_pwd -----------------------------7e713d354f0fa6--
import requests from requests_toolbelt import MultipartEncoder headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko', } data = MultipartEncoder(fields={'username': log_username, 'password': log_pwd}, boundary='---------------------------7e713d354f0fa6') headers['Content-Type'] = data.content_type url = 'http://xxx/index.html#/user/login' r = requests.post(url, data=data.to_string().decode(), headers=headers, verify=False) token = r.json()['data']['token']
标签:username,log,request,表单,headers,MultipartEncoder,data,7e713d354f0fa6 From: https://www.cnblogs.com/daizichuan/p/18473696