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