scrapy post请求 multipart/form-data
https://blog.csdn.net/summerpowerz/article/details/80293235
"Content-Type": "multipart/form-data; boundary=----WebKitFormBoundaryp20mobDusfUBBpya",
''''
安装依赖包
pip install requests_toolbelt
''''
from requests_toolbelt import MultipartEncoder
headers = {
"Content-Type": "multipart/form-data; boundary=----WebKitFormBoundaryp20mobDusfUBBpya"
}
data = {
"ANONYMOUS_TOKEN": ANONYMOUS_TOKEN,
"ENTRY": ENTRY,
"ENTRY_TYPE": ENTRY_TYPE
}
encoder = MultipartEncoder(data, boundary='----WebKitFormBoundaryp20mobDusfUBBpya')
me_body = encoder.to_string()
yield Request(url,
method='POST',
callback=self.parse_details,
meta={'handle_httpstatus_list': [301, 302]},
body=me_body,
headers=headers,
dont_filter=True
)