CURL.1 manual page
Name
Curl-transfer a URL
Summary
curl[options] [URL ...]
Describe
CURL is a tool that transmits data to or from the server, which supports HTTP, HTTPS,
Protocols such as FTP, FTPS, SCP, SFTP, TFTP, DICT, TELNET, LDAP, or
When Curl submits a POST request to a website address, it will return a file. If the output will output the content of this file, how can we get the returned file name or how can we save this file? {code ...} $ rinfocurl_getinfo ($ curl); if
First, write a simple crawl page function
Copy Code code as follows:
function Getsources ($URL, $User _agent= ', $Referer _url= ')//crawl a specified page
{
$URL page address that needs to be crawled
$User _agent need to return
PHP curl can be used to crawl Web pages, analysis of Web data use, simple and easy-to-use, here to introduce its functions, such as not detailed description, put the code to see:
Only a few of the main functions are retained. To implement a mock
Getting started with Linux: Setting custom HTTP headers in curl
Problem: I am trying to use the curl command to get a URL, but I also want to set some custom header fields in the outgoing HTTP request. How can I use custom HTTP headers in curl?
Curl
Demo Code
Operation effect (Figure 1)
Operation effect (Figure 2)
Main Package function
Multi_process ();According to the parameters, create the number of pointers to the child process.Bright spot Function 1: The
Download a single file and print the output to the standard output (stdout) by default.
curl http://www.centos.org
Use the-O/-O option to save the downloaded file to the specified file:-O: saves the file as the file name specified in the command
curl_setopt--Sets an option for the curl callDescribe BOOL curl_setopt (INT-ch, string option, mixed value) The curl_setopt () function sets the option for a curl session. The option parameter is the setting you want, and value is the values
download a single file and print the output to the standard output (STDOUT) in Curl HTTP by default://www.centos.orgSave the downloaded file to the specified file via the-o/-o option:-o: Save the file as the file name specified on the command line-O:
Original address: http://www.thegeekstuff.com/2012/04/curl-examples/Download a single file and print the output to standard output (STDOUT) by defaultCurl http://www.centos.orgSave the downloaded file to the specified file with the-o/-o option:-O:
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.