{"id":11982,"date":"2017-03-02T16:40:51","date_gmt":"2017-03-02T21:40:51","guid":{"rendered":"http:\/\/jianmingli.com\/wp\/?p=11982"},"modified":"2017-03-02T16:41:49","modified_gmt":"2017-03-02T21:41:49","slug":"curl-for-windows","status":"publish","type":"post","link":"https:\/\/jianmingli.com\/wp\/?p=11982","title":{"rendered":"curl For Windows"},"content":{"rendered":"<p>* Download curl, e.g. <a href=\"https:\/\/dl.uxnr.de\/build\/curl\/curl_winssl_msys2_mingw64_stc\/curl-7.53.1\/curl-7.53.1.zip\">curl-7.53.1.zip<\/a>, from <a href=\"https:\/\/curl.haxx.se\/download.html\">https:\/\/curl.haxx.se\/download.html<\/a><br \/>\n* Extract curl.exe into target directory, e.g. <em>c:\\prog\\curl<\/em><br \/>\n* Start using curl<\/p>\n<pre lang=\"bash\">\r\nC:\\prog\\curl>curl --help\r\nUsage: curl [options...] <url>\r\nOptions: (H) means HTTP\/HTTPS only, (F) means FTP only\r\n     --anyauth       Pick \"any\" authentication method (H)\r\n -a, --append        Append to target file when uploading (F\/SFTP)\r\n     --basic         Use HTTP Basic Authentication (H)\r\n     --cacert FILE   CA certificate to verify peer against (SSL)\r\n     --capath DIR    CA directory to verify peer against (SSL)\r\n -E, --cert CERT[:PASSWD]  Client certificate file and password (SSL)\r\n     --cert-status   Verify the status of the server certificate (SSL)\r\n     --cert-type TYPE  Certificate file type (DER\/PEM\/ENG) (SSL)\r\n     --ciphers LIST  SSL ciphers to use (SSL)\r\n     --compressed    Request compressed response (using deflate or gzip)\r\n -K, --config FILE   Read config from FILE\r\n     --connect-timeout SECONDS  Maximum time allowed for connection\r\n     --connect-to HOST1:PORT1:HOST2:PORT2 Connect to host (network level)\r\n -C, --continue-at OFFSET  Resumed transfer OFFSET\r\n -b, --cookie STRING\/FILE  Read cookies from STRING\/FILE (H)\r\n -c, --cookie-jar FILE  Write cookies to FILE after operation (H)\r\n     --create-dirs   Create necessary local directory hierarchy\r\n     --crlf          Convert LF to CRLF in upload\r\n     --crlfile FILE  Get a CRL list in PEM format from the given file\r\n -d, --data DATA     HTTP POST data (H)\r\n     --data-raw DATA  HTTP POST data, '@' allowed (H)\r\n     --data-ascii DATA  HTTP POST ASCII data (H)\r\n     --data-binary DATA  HTTP POST binary data (H)\r\n     --data-urlencode DATA  HTTP POST data url encoded (H)\r\n     --delegation STRING  GSS-API delegation permission\r\n     --digest        Use HTTP Digest Authentication (H)\r\n     --disable-eprt  Inhibit using EPRT or LPRT (F)\r\n     --disable-epsv  Inhibit using EPSV (F)\r\n     --dns-servers   DNS server addrs to use: 1.1.1.1;2.2.2.2\r\n     --dns-interface  Interface to use for DNS requests\r\n     --dns-ipv4-addr  IPv4 address to use for DNS requests, dot notation\r\n     --dns-ipv6-addr  IPv6 address to use for DNS requests, dot notation\r\n -D, --dump-header FILE  Write the received headers to FILE\r\n     --egd-file FILE  EGD socket path for random data (SSL)\r\n     --engine ENGINE  Crypto engine (use \"--engine list\" for list) (SSL)\r\n     --expect100-timeout SECONDS How long to wait for 100-continue (H)\r\n -f, --fail          Fail silently (no output at all) on HTTP errors (H)\r\n     --fail-early    Fail on first transfer error, do not continue\r\n     --false-start   Enable TLS False Start.\r\n -F, --form CONTENT  Specify HTTP multipart POST data (H)\r\n     --form-string STRING  Specify HTTP multipart POST data (H)\r\n     --ftp-account DATA  Account data string (F)\r\n     --ftp-alternative-to-user COMMAND  String to replace \"USER [name]\" (F)\r\n     --ftp-create-dirs  Create the remote dirs if not present (F)\r\n     --ftp-method [MULTICWD\/NOCWD\/SINGLECWD]  Control CWD usage (F)\r\n     --ftp-pasv      Use PASV\/EPSV instead of PORT (F)\r\n -P, --ftp-port ADR  Use PORT with given address instead of PASV (F)\r\n     --ftp-skip-pasv-ip  Skip the IP address for PASV (F)\r\n     --ftp-pret      Send PRET before PASV (for drftpd) (F)\r\n     --ftp-ssl-ccc   Send CCC after authenticating (F)\r\n     --ftp-ssl-ccc-mode ACTIVE\/PASSIVE  Set CCC mode (F)\r\n     --ftp-ssl-control  Require SSL\/TLS for FTP login, clear for transfer (F)\r\n -G, --get           Send the -d data with a HTTP GET (H)\r\n -g, --globoff       Disable URL sequences and ranges using {} and []\r\n -H, --header LINE   Pass custom header LINE to server (H)\r\n -I, --head          Show document info only\r\n -h, --help          This help text\r\n     --hostpubmd5 MD5  Hex-encoded MD5 string of the host public key. (SSH)\r\n -0, --http1.0       Use HTTP 1.0 (H)\r\n     --http1.1       Use HTTP 1.1 (H)\r\n     --http2         Use HTTP 2 (H)\r\n     --http2-prior-knowledge  Use HTTP 2 without HTTP\/1.1 Upgrade (H)\r\n     --ignore-content-length  Ignore the HTTP Content-Length header\r\n -i, --include       Include protocol headers in the output (H\/F)\r\n -k, --insecure      Allow connections to SSL sites without certs (H)\r\n     --interface INTERFACE  Use network INTERFACE (or address)\r\n -4, --ipv4          Resolve name to IPv4 address\r\n -6, --ipv6          Resolve name to IPv6 address\r\n -j, --junk-session-cookies  Ignore session cookies read from file (H)\r\n     --keepalive-time SECONDS  Wait SECONDS between keepalive probes\r\n     --key KEY       Private key file name (SSL\/SSH)\r\n     --key-type TYPE  Private key file type (DER\/PEM\/ENG) (SSL)\r\n     --krb LEVEL     Enable Kerberos with security LEVEL (F)\r\n     --libcurl FILE  Dump libcurl equivalent code of this command line\r\n     --limit-rate RATE  Limit transfer speed to RATE\r\n -l, --list-only     List only mode (F\/POP3)\r\n     --local-port RANGE  Force use of RANGE for local port numbers\r\n -L, --location      Follow redirects (H)\r\n     --location-trusted  Like '--location', and send auth to other hosts (H)\r\n     --login-options OPTIONS  Server login options (IMAP, POP3, SMTP)\r\n -M, --manual        Display the full manual\r\n     --mail-from FROM  Mail from this address (SMTP)\r\n     --mail-rcpt TO  Mail to this\/these addresses (SMTP)\r\n     --mail-auth AUTH  Originator address of the original email (SMTP)\r\n     --max-filesize BYTES  Maximum file size to download (H\/F)\r\n     --max-redirs NUM  Maximum number of redirects allowed (H)\r\n -m, --max-time SECONDS  Maximum time allowed for the transfer\r\n     --metalink      Process given URLs as metalink XML file\r\n     --negotiate     Use HTTP Negotiate (SPNEGO) authentication (H)\r\n -n, --netrc         Must read .netrc for user name and password\r\n     --netrc-optional  Use either .netrc or URL; overrides -n\r\n     --netrc-file FILE  Specify FILE for netrc\r\n -:, --next          Allows the following URL to use a separate set of options\r\n     --no-alpn       Disable the ALPN TLS extension (H)\r\n -N, --no-buffer     Disable buffering of the output stream\r\n     --no-keepalive  Disable keepalive use on the connection\r\n     --no-npn        Disable the NPN TLS extension (H)\r\n     --no-sessionid  Disable SSL session-ID reusing (SSL)\r\n     --noproxy       List of hosts which do not use proxy\r\n     --ntlm          Use HTTP NTLM authentication (H)\r\n     --ntlm-wb       Use HTTP NTLM authentication with winbind (H)\r\n     --oauth2-bearer TOKEN  OAuth 2 Bearer Token (IMAP, POP3, SMTP)\r\n -o, --output FILE   Write to FILE instead of stdout\r\n     --pass PASS     Pass phrase for the private key (SSL\/SSH)\r\n     --path-as-is    Do not squash .. sequences in URL path\r\n     --pinnedpubkey FILE\/HASHES Public key to verify peer against (SSL)\r\n     --post301       Do not switch to GET after following a 301 redirect (H)\r\n     --post302       Do not switch to GET after following a 302 redirect (H)\r\n     --post303       Do not switch to GET after following a 303 redirect (H)\r\n     --preproxy [PROTOCOL:\/\/]HOST[:PORT] Proxy before HTTP(S) proxy\r\n -#, --progress-bar  Display transfer progress as a progress bar\r\n     --proto PROTOCOLS  Enable\/disable PROTOCOLS\r\n     --proto-default PROTOCOL  Use PROTOCOL for any URL missing a scheme\r\n     --proto-redir PROTOCOLS   Enable\/disable PROTOCOLS on redirect\r\n -x, --proxy [PROTOCOL:\/\/]HOST[:PORT]  Use proxy on given port\r\n     --proxy-anyauth  Pick \"any\" proxy authentication method (H)\r\n     --proxy-basic   Use Basic authentication on the proxy (H)\r\n     --proxy-digest  Use Digest authentication on the proxy (H)\r\n     --proxy-cacert FILE CA certificate to verify peer against for proxy (SSL)\r\n     --proxy-capath DIR CA directory to verify peer against for proxy (SSL)\r\n     --proxy-cert CERT[:PASSWD] Client certificate file and password for proxy (SSL)\r\n     --proxy-cert-type TYPE Certificate file type (DER\/PEM\/ENG) for proxy (SSL)\r\n     --proxy-ciphers LIST SSL ciphers to use for proxy (SSL)\r\n     --proxy-crlfile FILE Get a CRL list in PEM format from the given file for proxy\r\n     --proxy-insecure Allow connections to SSL sites without certs for proxy (H)\r\n     --proxy-key KEY Private key file name for proxy (SSL)\r\n     --proxy-key-type TYPE Private key file type for proxy (DER\/PEM\/ENG) (SSL)\r\n     --proxy-negotiate  Use HTTP Negotiate (SPNEGO) authentication on the proxy (H)\r\n     --proxy-ntlm    Use NTLM authentication on the proxy (H)\r\n     --proxy-header LINE Pass custom header LINE to proxy (H)\r\n     --proxy-pass PASS Pass phrase for the private key for proxy (SSL)\r\n     --proxy-ssl-allow-beast Allow security flaw to improve interop for proxy (SSL)\r\n     --proxy-tlsv1   Use TLSv1 for proxy (SSL)\r\n     --proxy-tlsuser USER TLS username for proxy\r\n     --proxy-tlspassword STRING TLS password for proxy\r\n     --proxy-tlsauthtype STRING TLS authentication type for proxy (default SRP)\r\n     --proxy-service-name NAME  SPNEGO proxy service name\r\n     --service-name NAME  SPNEGO service name\r\n -U, --proxy-user USER[:PASSWORD]  Proxy user and password\r\n     --proxy1.0 HOST[:PORT]  Use HTTP\/1.0 proxy on given port\r\n -p, --proxytunnel   Operate through a HTTP proxy tunnel (using CONNECT)\r\n     --pubkey KEY    Public key file name (SSH)\r\n -Q, --quote CMD     Send command(s) to server before transfer (F\/SFTP)\r\n     --random-file FILE  File for reading random data from (SSL)\r\n -r, --range RANGE   Retrieve only the bytes within RANGE\r\n     --raw           Do HTTP \"raw\"; no transfer decoding (H)\r\n -e, --referer       Referer URL (H)\r\n -J, --remote-header-name  Use the header-provided filename (H)\r\n -O, --remote-name   Write output to a file named as the remote file\r\n     --remote-name-all  Use the remote file name for all URLs\r\n -R, --remote-time   Set the remote file's time on the local output\r\n -X, --request COMMAND  Specify request command to use\r\n     --resolve HOST:PORT:ADDRESS  Force resolve of HOST:PORT to ADDRESS\r\n     --retry NUM   Retry request NUM times if transient problems occur\r\n     --retry-connrefused  Retry on connection refused (use with --retry)\r\n     --retry-delay SECONDS  Wait SECONDS between retries\r\n     --retry-max-time SECONDS  Retry only within this period\r\n     --sasl-ir       Enable initial response in SASL authentication\r\n -S, --show-error    Show error. With -s, make curl show errors when they occur\r\n -s, --silent        Silent mode (don't output anything)\r\n     --socks4 HOST[:PORT]  SOCKS4 proxy on given host + port\r\n     --socks4a HOST[:PORT]  SOCKS4a proxy on given host + port\r\n     --socks5 HOST[:PORT]  SOCKS5 proxy on given host + port\r\n     --socks5-hostname HOST[:PORT]  SOCKS5 proxy, pass host name to proxy\r\n     --socks5-gssapi-service NAME  SOCKS5 proxy service name for GSS-API\r\n     --socks5-gssapi-nec  Compatibility with NEC SOCKS5 server\r\n -Y, --speed-limit RATE  Stop transfers below RATE for 'speed-time' secs\r\n -y, --speed-time SECONDS  Trigger 'speed-limit' abort after SECONDS (default: 30)\r\n     --ssl           Try SSL\/TLS (FTP, IMAP, POP3, SMTP)\r\n     --ssl-reqd      Require SSL\/TLS (FTP, IMAP, POP3, SMTP)\r\n -2, --sslv2         Use SSLv2 (SSL)\r\n -3, --sslv3         Use SSLv3 (SSL)\r\n     --ssl-allow-beast  Allow security flaw to improve interop (SSL)\r\n     --ssl-no-revoke    Disable cert revocation checks (WinSSL)\r\n     --stderr FILE   Where to redirect stderr (use \"-\" for stdout)\r\n     --tcp-nodelay   Use the TCP_NODELAY option\r\n     --tcp-fastopen  Use TCP Fast Open\r\n -t, --telnet-option OPT=VAL  Set telnet option\r\n     --tftp-blksize VALUE  Set TFTP BLKSIZE option (must be >512)\r\n     --tftp-no-options  Do not send TFTP options requests\r\n -z, --time-cond TIME   Transfer based on a time condition\r\n -1, --tlsv1         Use >= TLSv1 (SSL)\r\n     --tlsv1.0       Use TLSv1.0 (SSL)\r\n     --tlsv1.1       Use TLSv1.1 (SSL)\r\n     --tlsv1.2       Use TLSv1.2 (SSL)\r\n     --tlsv1.3       Use TLSv1.3 (SSL)\r\n     --trace FILE    Write a debug trace to FILE\r\n     --trace-ascii FILE  Like --trace, but without hex output\r\n     --trace-time    Add time stamps to trace\/verbose output\r\n     --tr-encoding   Request compressed transfer encoding (H)\r\n -T, --upload-file FILE  Transfer FILE to destination\r\n     --url URL       URL to work with\r\n -B, --use-ascii     Use ASCII\/text transfer\r\n -u, --user USER[:PASSWORD]  Server user and password\r\n     --tlsuser USER  TLS username\r\n     --tlspassword STRING  TLS password\r\n     --tlsauthtype STRING  TLS authentication type (default: SRP)\r\n     --unix-socket PATH    Connect through this Unix domain socket\r\n     --abstract-unix-socket PATH Connect to an abstract Unix domain socket\r\n -A, --user-agent STRING  Send User-Agent STRING to server (H)\r\n -v, --verbose       Make the operation more talkative\r\n -V, --version       Show version number and quit\r\n -w, --write-out FORMAT  Use output FORMAT after completion\r\n     --xattr         Store metadata in extended file attributes\r\n -q, --disable       Disable .curlrc (must be first parameter)\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>* Download curl, e.g. curl-7.53.1.zip, from https:\/\/curl.haxx.se\/download.html * Extract curl.exe into target directory, e.g. c:\\prog\\curl * Start using curl C:\\prog\\curl>curl &#8211;help Usage: curl [options&#8230;] Options: (H) means HTTP\/HTTPS only, (F) means FTP only &#8211;anyauth Pick &#8220;any&#8221; authentication method (H) -a, &hellip; <a href=\"https:\/\/jianmingli.com\/wp\/?p=11982\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":true,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[81],"tags":[756],"class_list":["post-11982","post","type-post","status-publish","format-standard","hentry","category-util","tag-curl"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8cRUO-37g","_links":{"self":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/11982","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=11982"}],"version-history":[{"count":2,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/11982\/revisions"}],"predecessor-version":[{"id":11984,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/11982\/revisions\/11984"}],"wp:attachment":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=11982"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=11982"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=11982"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}