About Libcurl Simulation Submission Form

Source: Internet
Author: User
Tags php script

Because I know less about the web mechanism, I have encountered many problems in using C/libcurl. The main solution:

1, find the location of the submission form in the source page. That is, the page file corresponds to the action property in the form . are often submitted to scripts such as JSP or PHP, instead of being submitted directly to this page.

2, be aware of HTTP headers . different HTTP headers can cause different responses to Web pages . I do a small project, when submitted to two URLs PHP script, because the HTTP header caused by PHP script execution is incorrect.

3, redirect problem.

In some Web pages, the returned page data will have redirect information , which opens curl_easy_setopt (curl, curlopt_followlocation, true);

In my current grasp, this parameter automatically tracks redirects in the HTTP header. The reason here is to open is because the redirect has a timeout parameter, if it fails to link,

It can also cause problems with Web page execution.

4, about HTTPS, when compiling Libcurl to join the support of OpenSSL.

5. Add curl_easy_setopt (Curl, Curlopt_verbose, 1L) to the code to track the transmission status of the data.

6, if still can not solve, use Fiddler grab bag. It is more convenient and faster than the Wireshark,fiddler crawl HTTPS package.

Finally, the sixth article:fiddler can be more convenient to catch HTTPS, through the difference between the package can easily solve the various problems encountered.

About Libcurl Simulation Submission Form

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.