Lines Matching full:curl
8 The Art Of Scripting HTTP Requests Using Curl
77 Curl is a command line tool for doing all sorts of URL manipulations and
80 invoke 'curl --help' or 'curl --manual' to get basic information about it.
82 Curl is not written to do everything for you. It makes the requests, it gets
98 The client, curl, sends a HTTP request. The request contains a method (like
106 Using curl's option --verbose (-v as a short option) will display what kind
107 of commands curl sends to the server, as well as a few other informational
111 understand the curl<->server interaction.
114 even more details as they show EVERYTHING curl sends and receives. Use it
117 curl --trace-ascii debugdump.txt http://www.example.com/
126 curl --trace-ascii d.txt --trace-time http://example.com/
130 By default curl sends the response to stdout. You need to redirect it
139 https://curl.haxx.se or https://yourbank.com a million times. RFC 3986 is the
145 address and that's what curl will communicate with. Alternatively you specify
149 IP address for a host name than what would otherwise be used, by using curl's
152 curl --resolve www.example.org:80:127.0.0.1 http://www.example.org/
156 Each protocol curl supports operate on a default port number, be it over TCP
163 curl http://www.example.org:1234/
167 need to specify that proxy's port number separate on what curl needs to
170 curl --proxy http://proxy.example.org:4321 http://remote.example.org/
181 curl http://user:password@example.org/
185 curl -u user:password http://example.org/
206 curl https://curl.haxx.se
212 use curl's --include (-i) option to display them as well as the rest of the
218 option which will make curl issue a HEAD request. In some special cases
229 A single curl command line may involve one or many URLs. The most common case
236 curl http://url1.example.com http://url2.example.com
243 curl --data name=curl http://url1.example.com http://url2.example.com
254 When curl reaches the --next on the command line, it'll sort of reset the
260 curl -I http://example.com --next http://example.com
264 curl -d score=10 http://example.com/post.cgi --next http://example.com/results.html
303 To make curl do the GET form post for you, just enter the expected created
306 curl "http://www.hotmail.com/when/junk.cgi?birthyear=1905&press=OK"
327 And to use curl to post this form with the same data filled in as before, we
330 curl --data "birthyear=1905&press=%20OK%20" \
336 The data you send to the server MUST already be properly encoded, curl will
341 Recent curl versions can in fact url-encode POST data for you, like this:
343 curl --data-urlencode "name=I am Daniel" http://www.example.com
345 If you repeat --data several times on the command line, curl will
366 To post to a form like this with curl, you enter a command line like:
368 curl --form upload=@localfilename --form press=OK [URL]
386 To post this with curl, you won't have to think about if the fields are
387 hidden or not. To curl they're all the same:
389 curl --data "birthyear=1905&press=OK&person=daniel" [URL]
393 When you're about fill in a form and send to a server by using curl instead
412 Put a file to a HTTP server with curl:
414 curl --upload-file uploadfile http://www.example.com/receive.cgi
422 doing. The Basic authentication used in HTTP (which is the type curl uses by
427 To tell curl to use a user and password for authentication:
429 curl --user name:password http://www.example.com
442 the Internet. To specify those with curl, run something like:
444 curl --proxy-user proxyuser:proxypassword curl.haxx.se
450 part, curl will prompt for the password interactively.
472 do it. Using curl, you can put anything you want in the referer-field and
475 Use curl to set the referer field with:
477 curl --referer http://www.example.come http://www.example.com
488 At times, you will see that getting a page with curl will not return the same
493 To make curl look like Internet Explorer 5 on a Windows 2000 box:
495 curl --user-agent "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)" [URL]
499 curl --user-agent "Mozilla/4.73 [en] (X11; U; Linux 2.2.15 i686)" [URL]
510 Curl does not follow Location: headers by default, but will simply display
514 To tell curl to follow a Location:
516 curl --location http://www.example.com
518 If you use curl to POST to a site that immediately redirects you to another
519 page, you can safely use --location (-L) and --data/--form together. Curl will
525 Browser typically support at least two other ways of redirects that curl
545 into a single logical session. To be able to use curl in such occasions, we
552 curl is to add them on the command line like:
554 curl --cookie "name=Daniel" http://www.example.com
556 Cookies are sent as common HTTP headers. This is practical as it allows curl
557 to record cookies simply by recording headers. Record cookies with curl by
560 curl --dump-header headers_and_cookies http://www.example.com
565 Curl has a full blown cookie parsing engine built-in that comes to use if you
569 you run curl like:
571 curl --cookie stored_cookies_in_file http://www.example.com
573 Curl's "cookie engine" gets enabled when you use the --cookie option. If you
574 only want curl to understand received cookies, use --cookie with a file that
575 doesn't exist. Example, if you want to let curl understand cookies from a
579 curl --cookie nada --location http://www.example.com
581 Curl has the ability to read and write cookie files that use the same file
585 --cookie-jar (-c) option you'll make curl write a new cookie file at the end
588 curl --cookie cookies.txt --cookie-jar newcookies.txt \
604 Curl supports encrypted fetches when built to use a TLS library and it can be
605 built to use one out of a fairly large set of libraries - "curl -V" will show
606 which one your curl was built to use (if any!). To get a page from a HTTPS
607 server, simply run curl like:
609 curl https://secure.example.com
614 you claim to be, as an addition to normal passwords. Curl supports client-
616 need to enter before the certificate can be used by curl. The pass phrase
618 curl queries for it. Use a certificate with curl on a HTTPS server like:
620 curl --cert mycert.pem https://secure.example.com
622 curl also tries to verify that the server is who it claims to be, by
624 bundle. Failing the verification will cause curl to deny the connection. You
625 must then use --insecure (-k) in case you want to tell curl to ignore that
631 https://curl.haxx.se/docs/sslcerts.html
634 curl to use that to verify the server's certificate:
636 curl --cacert ca-bundle.pem https://example.com/
643 Doing fancy stuff, you may need to add or change elements of a single curl
649 curl --data "<xml>" --header "Content-Type: text/xml" \
655 curl --header "Host:" http://www.example.com
660 curl --header "Destination: http://nowhere" http://example.com
664 It should be noted that curl selects which methods to use on its own
667 curl selects, but you will not modify curl's behavior. This means that if you
669 PROPFIND with -X and curl will still think it sends a POST. You can change
673 curl -X POST http://example.org/
675 ... but curl will still think and act as if it sent a GET so it won't send any
685 work and how to login to them using curl.
688 will most certainly need to script things and do multiple curl invokes etc.
714 Many times when you run curl on a site, you'll notice that the site doesn't
715 seem to respond the same way to your curl requests as it does to your
718 Then you need to start making your curl requests more similar to your
758 https://curl.haxx.se is the home of the curl project