Installation and use of curl

Source: Internet
Author: User
Tags curl http authentication http post

Linux under the Curl Extension installation, record (found on the internet a lot of plagiarism is not detected can be used)

1. Download the Curl installation package: https://curl.haxx.se/download.html

2. Unzip: such as Tar zxvf curl-7.39.0.tar.gz

3. Enter the extracted Curl folder: CD curl-7.39.0

4. Enter:./configure--prefix=/usr/local/curl

5 input: Make && make install

Linux Curl Command-a/--append when uploading a file, attach to target file-a/--user-agent <string> set user agent to send to server-Anyauth can use "any" authentication method-b/--cookie <name= String/file> cookie string or file read location-Basic uses HTTP Basic authentication-B/--USE-ASCII using ASCII/text transfer-c/--cookie-jar <file> The cookie is written to this file after the operation-c/--continue-at <offset> breakpoint Continuation-d/--data <data> HTTP post to transmit the data--data-ascii <data > post data in ASCII mode--data-binary <data> post data in binary mode--negotiate using HTTP authentication--digest use digital authentication--disable-eprt Prohibit use of eprt or LPRT--DISABLE-EPSV prohibit use of Epsv-d/--dump-header <file> write header information to the file--egd-file <file> for random data (SSL Set EGD socket path--tcp-nodelay use 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 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" for List--cacert <file> CA certificate (SSL)--capath <directory> CA directory (made using C_rehash) to verify PE ER against (SSL)--ciphers <list> SSL password--compressed requirements Return is a compressed situation (using deflate or gzip)--connect-timeout <seconds> Set the maximum request time--create-dirs establish the directory hierarchy for the local directory--crlf when you upload the LF switch to Crlf-f/--fail connection fails, the HTTP error is not displayed--ftp-create-dirs if the remote directory does not exist, Create remote directory--ftp-method [MULTICWD/NOCWD/SINGLECWD] control the use of CWD--FTP-PASV use PASV/EPSV instead of port--ftp-skip-pasv-ip when using PASV, Ignore this IP address--ftp-ssl attempt to use SSL/TLS for FTP data transfer--FTP-SSL-REQD require FTP data transfer with SSL/TLS-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 use {} and []-g/--get to send data in a get way-h/-- Help-h/--header <line> Custom header information passed to the server--ignore-content-length ignore the length of the HTTP header information-i/--include include protocol header information when output-i/-- Head only displays document information read from file-j/--junk-session-cookies ignore session cookie-interface <interface> Specify network interface/address usage-KRB4 < level > Enable with the specified security level krb4-j/--junk-session-cookies read file into ignore session Cookie--interface <interface> use specified network interface/address--KRB4 < Level> using the specified security level krb4-k/--insecure allows the specified profile to be read-l/--list-only not using the certificate to the SSL site-k/--config lists the file names in the FTP directory--limit-rate <ratE> Set transfer speed--local-port<num> Force local port number-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 downloaded-m/--manual display full manual-n/--netrc read the user name and password--netrc-optional use from the Netrc file. NETRC or URL to overwrite-N--NTLM use HTTP NTLM authentication-n/--no-buffer Disable buffered output-o/--output write the output to the file-o/--remote-name write the output to the file, Keep the file name of the remote Files-p/--proxytunnel use the HTTP proxy--proxy-anyauth to select either Proxy authentication method--proxy-basic use Basic authentication on the proxy--proxy-digest Use the digital authentication on the proxy--PROXY-NTLM to use NTLM authentication on the proxy-p/--ftp-port <address> use the port address instead of Pasv-q/--quote <cmd> file transfer before using the Send command to server-r/--range <range> retrieve random files from http/1.1 or FTP server byte range--range-file read (SSL)-r/--remote-time when generating files locally Keep remote file time--retry <num> when there is a problem with the transmission, the number of retries--retry-delay <seconds> The retry interval is set when there is a problem with the transmission--retry-max-time <seconds > Set the maximum retry time-s/--silent Mute mode when there is a problem with the transmission. Do not output anything-s/--show-error display error--SOCKS4

Usage examples:

Curl-x GET http://172.28.14.63:8000/api/-  H "Authorization:basic cm9vddpbyteymzq1ng=="

Installation and use of curl

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.