Curl Command Usage

Source: Internet
Author: User

Cases:

Char buf[512] = {0};
sprintf (buf, "Curl%s/newwanbu/app/api/index.php/report/semail/aid/%d/reporttype/final/", g_profile.m_confData.m_ Url.c_str (), Activeid);

Curl http://wanbu.lvzy/NewWanbu/App/Api/index.php/Report/sEmail/aid/3429/reportType/final/
System (BUF);

Curl is an open source file Transfer tool that works with URL syntax in the command line mode. It is widely used in Unix, multiple Linux distributions, and has a ported version of DOS and Win32, Win64.Get pageUse the command: Curl Http://curl.haxx. Se This is the simplest way to use it. Use this command to get the Http://curl.haxx. Se points to the page, similarly, if the URL here points to a file or a picture can be downloaded directly to the local. If you are downloading an HTML document, the default will not display the file header, which is the header of the HTML document. To display all, add parameter-I, to display only the head, with the parameter-I. At any time, you can use the-v command to see how curl works, and all of the commands it sends to the server will be displayed. For a breakpoint to continue, you can use the-r parameter to specify the transmission range.Get FormIn Web page design, form is a very important element. form is usually used to collect and submit information to the website. There are two ways to submit information, the Get method and the Post method. The Get method is discussed first, such as in the page: <form method= "GET" action= "junk.cgi" ><input type=text name= "Birthyear" ><input Type=submit name=press value= "OK" ></form> a text box and a button labeled "OK" will appear on the browser. By pressing this button, the form submits the text box's data to the server using the Get method. For example the original page is in Www.hotmail. com/when/birth.html See, then you enter 1905 in the text box and then press the OK button, then the URL of the browser should now be: "Www.hotmail." Com/when/junk.cgi?birthyear=1905&press=ok "For this page, curl can be processed directly, for example to get the page above, just enter: Curl" www.hotmail. Com/when/junk.cgi?birthyear=1905&press=ok "It's OK. The second method that the form uses to submit information is called the Post method, the difference between the post method and the Get method is that when the Get method is used, the target URL is generated in the browser, and post does not. Like get, here's a webpage: <form method= "POST" action= "junk.cgi" ><input type=text name= "birthyear" ><input type= Submit name=press value= "OK" ></form> a text box and a button labeled "OK" will also appear on the browser. By pressing this button, the table submits data to the server with the Post method alone. At this point the URL is not visible, so you need to use a special method to crawl this page: curl-d "Birthyear=1905&press=ok" Www.hotmail. com/when/junk.cgi This command can be done. By the end of 1995, RFC 1867 defined a new post method for uploading files. Mainly used to upload local files to the server. This is how the page reads: <form method= "POST" enctype= ' Multipart/form-data ' action= "upload.cgi" ><input type=file name=upload><input type= Submit name=press value= "OK" ></form> for this page, Curl usage differs: curl-f [email protected]-F Press=ok URL The essence of this command is to upload local files to the server using post. There are many ways to use the post, and users can explore it on their own.using putThe standard way to upload HTTP protocol files is to use put, at which time the Curl command uses the-t parameter: curl-t uploadfile www.uploadhttp. com/receive.cgi

Curl Command Usage

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.