Scrapy Post Request Payload type value

Source: Internet
Author: User

The type values are as follows:

The form form for the Web site is as follows:

Data type: Multipart/form-data, four of the most common post submission method is used to upload files, while using boundary to separate different fields, to avoid duplication of content (Baidu check)

Using the Requests module test, the comparison pit was measured for 2 hours (small white does not know how to pass the value) to get the conclusion:

The boundary in payload is the same as the value in headers:

The local payload format is:

Turn the page by changing the corresponding value, and next use the scrapy operation

Precautions:

I use Scrapy. Formrequest transfer parameters can not be successful, debug after the relevant reasons, there has been no running results, continue to search online information:

Use Scrapy instead. Request for post data in the following format:

Before the use of Body=json.dumps (Form_data), run failed, do not know what the reason, the test found direct form_data can be

Headers be sure to add the Content-type field, my headers is:

Rerun the project and discover the success of the run

Scrapy Post Request Payload type value

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.