Curl Get
GET is used by default with curl requests. If you use curl to make HTTP requests other than GET, you need to specify the HTTP method. Unpacking the weather API curl request. Let’s look more closely at the request you submitted for the weather in the previous topic (Make a curl call). Curl -T 'img1-1000.png' ftp://ftp.picturemania.com/upload/ -I-head: Fetch the HTTP-header only! (HTTP/FTP/FILE) HTTP-servers feature the command HEAD which this uses to get nothing but the header of a document. When used on an FTP or FILE file, curl displays the file size and last modification time only.-u user:password-user user:password.
Curl command file utility supports for downloading and uploading files. Curl is useful for many works with system administration, web development for calling web services, etc. In this tutorial we are providing 5 curl frequently used commands to download files from remote servers.
1. cURL Command to Download and Save File
Curl Get -d
To simply download a file using curl use following syntax. -O is used for saving file on the local system with the same name on the remote system.
2. cURL Download and Save with Other Name
If you want to save file with different name on local system, Use -o with new file name.
3. cURL to Download Multiple Files
Curl also provides an option to download multiple files simultaneously. To download multiple file use following syntax. All files will be saves with original file names.
4. Passing Login Credential with cURL Download
In case files are behind authenticated http or ftp server. You can pass login credentials using -u command line parameter like below examples.
Curl Get Headers
5. cURL Download File via Proxy Server
Curl Get Response Code
If server file is only available through a proxy server, or you want to use a proxy for downloading files, Use -x followed by proxy address and port to download the file via a proxy server.