Use the Curl Command && Common Curl command under Windows

Source: Internet
Author: User
Tags add time http authentication http post

What is a curl command?

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.

How do I use the Curl command under Windows?

The first step: go to Curl Download official website, download the appropriate version, I download here is Windows 64-bit curl.

Where I downloaded the zip file. In addition the CAB file is also compressed files, which is produced by Microsoft, is not very useful, it is recommended to use zip compressed files.

The second step: Unzip the file, and then locate the file directory under the bin sub-file (Bin is a binary file, also known as the executable file), copy the file address:

Step three: Add the address to the environment variable.

Fourth step: Open cmd, then enter Curl--help, if shown below, will represent success.

Common Curl Commands

The command parameters are as follows:

-a/--append attaching to the destination file when uploading a file-a/--user-agent <string>set up user agent to send to server-Anyauth can use the "any" authentication method-b/--cookie <name=string/file>cookie string or file read location-Basic authentication using HTTP-b/--use-ascii using ASCII/Text Transfer-c/--cookie-jar <file>The cookie is written to this file after the operation is completed.-c/--Continue-at <offset>Breakpoint Continuation-d/--data <data>HTTP Post Way to transmit data--data-ascii <data>post data in ASCII mode--data-binary <data>post data in binary mode--negotiate using HTTP authentication--Digest using digital authentication--disable-Eprt prohibit the use of eprt or LPrt--disable-EPSV prohibit the use of EPSV-d/--dump-header <file>Write header information to the file--egd-file <file>set EGD socket path for random data (SSL)--tcp-Nodelay using the tcp_nodelay option-e/--referer Source URL-e/--cert <cert[:p asswd]>client certificate file and password (SSL)--cert-type <type> certificate file type (der/pem/ENG) (SSL)--key <key>private Key file name (SSL)--key-type <type> private key file type (der/pem/ENG) (SSL)--pass <pass>private Key Password (SSL)--engine <eng> Encryption engine use (SSL)."--engine List"  forList--cacert <file>CA Certificate (SSL)--capath <directory> CA Directory (madeusingc_rehash) to verify peer against (SSL)--ciphers <list>SSL Password--compressed requirements Return is a compressed situation (usingdeflate or gzip)--connect-timeout <seconds>set maximum request time--create-dirs Creating a directory hierarchy of local directories--CRLF upload is to convert LF into CRLF-f/--Fail connection fails when HTTP error is not displayed--ftp-create-dirs If the remote directory does not exist, create a remote directory--ftp-method [multicwd/nocwd/SINGLECWD] Controlling the use of CWD--FTP-PASV using pasv/EPSV instead of Port--ftp-skip-pasv-when IP is using PASV, ignore the IP address--ftp-ssl try to use ssl/TLS for FTP data transfer--FTP-SSL-REQD requires ssl/TLS for FTP data transfer-f/--form <name=content>simulate HTTP form submission Data-form-string<name=string>simulate HTTP form submission Data-g/--globoff Disable URL sequence and range using {} and []-g/--Getsend data in a get way-h/--Help-h/--header <line>Custom header information is passed to the server--ignore-content-length of the HTTP header information ignored-i/--include protocol header information when included output-i/--The head only shows the document information read from the file-j/--junk-session-Cookies Ignore session cookies-Interface <Interface> Specify the network interface/Address Use-Krb4 < level >enable with the specified security level KRB4-j/--junk-session-cookies read file into ignore session cookie--Interface<Interface> Using a specified network interface/Address--KRB4 <level>KRB4 with the specified security level-k/--insecure allow non-use of certificates to SSL sites-k/--config file read specified by configuration-l/--list-Only list the file names under the FTP directory--limit-rate <rate>Set transfer speed--local-port<num>forcing the local port number to be used-m/--max-time <seconds>set Maximum transfer time--max-redirs <num>set the maximum number of read directories--max-filesize <bytes>set the maximum amount of files to download-m/--Manual Display full manual-n/--NETRC to read the user name and password from the Netrc file--netrc-optional use. netrc or URL to overwrite-N--NTLM uses HTTP NTLM authentication-n/--no-buffer output is disabled in buffer-o/--output writes outputs to this file-o/--remote-name writes the output to the file, preserving the file name of the remote files-p/--Proxytunnel using an HTTP proxy--proxy-Anyauth Select either proxy authentication method--proxy-Basic authentication is used on the agent by Basic--proxy-Digest using digital authentication on the proxy--proxy-NTLM uses NTLM authentication on the agent-p/--ftp-port <address>use the port address instead of using the PASV-q/--quote <cmd>Send command to server before file transfer-r/--range <range> Retrieve from http/1. 1 or FTP server byte range--range-file Read (SSL) random files-r/--remote-time to preserve remote file times when generating files locally--retry <num>number of retries when there is a problem with the transmission--retry-delay <seconds>Setting the retry interval when there is a problem with the transport--retry-max-time <seconds>set the maximum retry time when there is a problem with the transport-s/--Silent Mute mode. Don't output anything.-s/--show-Error Display Errors--SOCKS4 using the SOCKS4 proxy for a given host and port--SOCKS5 using the SOCKS5 proxy for a given host and port--stderr <file>-t/--telnet-option <OPT=val>telnet option Settings--trace <file>debug a specified file--trace-ascii <file> Like--trace but no hex output--trace-time Tracking/when verbose output, add time stamp-t/--upload-file <file>Uploading Files--url <URL>Spet URL to work with-u/--user <user[:p assword]>set the user and password for the server-u/--proxy-user <user[:p assword]>set the proxy user name and password-v/--verbose-v/--version displays release information-w/--write- out[format] after what output is completed-x/--proxy using the HTTP proxy on a given port-x/--request <command>Specify what command-y/--speed-time to discard the speed limit. Default is-y/--speed-limit Stop transmission speed limit, speed time'seconds-z/--time-Cond transfer time setting-0/--HTTP1.0Using HTTP1.0-1/--TLSv1 using TLSv1 (SSL)-2/--Sslv2 using SSLv2 (SSL)-3/--SSLv3 used by SSLv3 (SSL)--3p-quote Like-q forThe source URL for3rd party Transfer--3p-URLs for third-party transfers using URLs--3p-user uses username and password for third-party transfer-4/--IPv4 using IP4-6/--IPv6 using IP6-#/--progress-bar Displays the current delivery status with a progress bar

  

Common commands are as follows (refer to Baidu Encyclopedia):

Curl www.baidu.com

Gets the document to a Web page.

Curl Www.baidu.com-i

In addition to obtaining the document, you can also get header information.

Curl Www.baidu.com-I

Just get the header information. No document.

Curl Www.baidu.com-v

Displays more detailed information, and V is the abbreviation for verbose.

You can see that there are processes that include parsing to IP.

Curl Www.baidu.com/s?wd=d

This is actually simulating the form form, which uses the Get method.

More can refer to Baidu encyclopedia.

Using the Curl Command && Common Curl commands under Windows

Related Article

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.