Lines Matching +full:https +full:- +full:proxy +full:- +full:agent
1 <!--
4 SPDX-License-Identifier: curl
5 -->
21 invoke `curl --help` or `curl --manual` to get basic information about it.
47 Using curl's option [`--verbose`](https://curl.se/docs/manpage.html#-v) (`-v`
51 `--verbose` is the single most useful option when it comes to debug or even
52 understand the curl<->server interaction.
54 Sometimes even `--verbose` is not enough. Then
55 [`--trace`](https://curl.se/docs/manpage.html#-trace) and
56 [`--trace-ascii`](https://curl.se/docs/manpage.html#--trace-ascii)
60 curl --trace-ascii debugdump.txt http://www.example.com/
67 [`--trace-time`](https://curl.se/docs/manpage.html#--trace-time) option is
70 curl --trace-ascii d.txt --trace-time http://example.com/
77 [`--trace-ids`](https://curl.se/docs/manpage.html#--trace-ids) option is what
81 curl --trace-ascii d.txt --trace-ids http://example.com/
86 somewhere to avoid that, most often that is done with `-o` or `-O`.
94 https://curl.se or https://example.com a million times. RFC 3986 is the
105 [`--resolve`](https://curl.se/docs/manpage.html#--resolve) option:
107 curl --resolve www.example.org:80:127.0.0.1 http://www.example.org/
121 offer its services. Sometimes you may use a proxy, and then you may
122 need to specify that proxy's port number separately from what curl needs to
123 connect to the server. Like when using an HTTP proxy on port 4321:
125 curl --proxy http://proxy.example.org:4321 http://remote.example.org/
140 curl -u user:password http://example.org/
143 is usually done and requested by user-oriented websites these days. They tend
161 curl https://curl.se
167 use curl's [`--include`](https://curl.se/docs/manpage.html#-i) (`-i`)
173 [`--head`](https://curl.se/docs/manpage.html#-I) (`-I`) option which makes
179 may see a `Content-Length:` in the response headers, but there must not be an
193 If you use [`--data`](https://curl.se/docs/manpage.html#-d) to POST to
199 curl --data name=curl http://url1.example.com http://url2.example.com
206 [`--next`](https://curl.se/docs/manpage.html#-:) option. It is basically a
208 before `--next` get the same method and get all the POST data merged into
211 When curl reaches the `--next` on the command line, it resets the method and
217 curl -I http://example.com --next http://example.com
221 curl -d score=10 http://example.com/post.cgi --next http://example.com/results.html
232 entered address on a map or using the info as a login-prompt verifying that
240 A GET-form uses the method GET, as specified in HTML like:
250 press-button labeled "OK". If you fill in '1905' and press the OK button,
290 curl --data "birthyear=1905&press=%20OK%20" http://www.example.com/when/junk.cgi
292 This kind of POST uses the Content-Type `application/x-www-form-urlencoded`
300 Recent curl versions can in fact url-encode POST data for you, like this:
302 curl --data-urlencode "name=I am Daniel" http://www.example.com
304 If you repeat `--data` several times on the command line, curl concatenates
305 all the given data pieces - and put a `&` symbol between each data segment.
311 RFC 1867-posting.
316 <form method="POST" enctype='multipart/form-data' action="upload.cgi">
321 This clearly shows that the Content-Type about to be sent is
322 `multipart/form-data`.
326 curl --form upload=@localfilename --form press=OK [URL]
349 curl --data "birthyear=1905&press=OK&person=daniel" [URL]
362 `?`-letter as GET forms are supposed to.
374 curl --upload-file uploadfile http://www.example.com/receive.cgi
389 curl --user name:password http://www.example.com
395 [`--ntlm`](https://curl.se/docs/manpage.html#--ntlm),
396 [`--digest`](https://curl.se/docs/manpage.html#--digest),
397 [`--negotiate`](https://curl.se/docs/manpage.html#--negotiate) or even
398 [`--anyauth`](https://curl.se/docs/manpage.html#--anyauth) might be
401 ## Proxy Authentication
404 proxy. This seems to be especially common at various companies. An HTTP proxy
408 curl --proxy-user proxyuser:proxypassword curl.se
410 If your proxy requires the authentication to be done using the NTLM method,
411 use [`--proxy-ntlm`](https://curl.se/docs/manpage.html#--proxy-ntlm), if
413 [`--proxy-digest`](https://curl.se/docs/manpage.html#--proxy-digest).
438 do it. Using curl, you can put anything you want in the referer-field and
443 curl --referer http://www.example.come http://www.example.com
445 ## User Agent
447 Similar to the referer field, all HTTP requests may set the User-Agent
448 field. It names what user agent (client) that is being used. Many
456 it is time to set the User Agent field to fool the server into thinking you
461 curl --user-agent "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)" [URL]
465 curl --user-agent "Mozilla/4.73 [en] (X11; U; Linux 2.2.15 i686)" [URL]
482 curl --location http://www.example.com
485 page, you can safely use [`--location`](https://curl.se/docs/manpage.html#-L)
486 (`-L`) and `--data`/`--form` together. Curl only uses POST in the first
520 curl --cookie "name=Daniel" http://www.example.com
524 using the [`--dump-header`](https://curl.se/docs/manpage.html#-D) (`-D`)
527 curl --dump-header headers_and_cookies http://www.example.com
530 [`--cookie-jar`](https://curl.se/docs/manpage.html#-c) option described
533 Curl has a full blown cookie parsing engine built-in that comes in use if you
535 previous connection (or hand-crafted manually to fool the server into
539 curl --cookie stored_cookies_in_file http://www.example.com
542 [`--cookie`](https://curl.se/docs/manpage.html#-b) option. If you only
543 want curl to understand received cookies, use `--cookie` with a file that
548 curl --cookie nada --location http://www.example.com
552 cookies between scripts or invokes. The `--cookie` (`-b`) switch
554 and by using the `--cookie-jar` (`-c`) option you make curl write a new
557 curl --cookie cookies.txt --cookie-jar newcookies.txt \
560 # HTTPS
562 ## HTTPS is HTTP secure
565 protocol for doing this is what is generally known as HTTPS, HTTP over
573 built to use one out of a fairly large set of libraries - `curl -V` shows
574 which one your curl was built to use (if any!). To get a page from an HTTPS
577 curl https://secure.example.com
581 In the HTTPS world, you use certificates to validate that you are the one
582 you claim to be, as an addition to normal passwords. Curl supports client-
586 curl queries for it. Use a certificate with curl on an HTTPS server like:
588 curl --cert mycert.pem https://secure.example.com
593 use [`--insecure`](https://curl.se/docs/manpage.html#-k) (`-k`) in case you
597 the [`SSLCERTS` document](https://curl.se/docs/sslcerts.html).
602 curl --cacert ca-bundle.pem https://example.com/
612 as `Content-Type: text/xml` (instead of the default `Content-Type`) like
615 curl --data "<xml>" --header "Content-Type: text/xml" \
616 --request PROPFIND example.com
621 curl --header "Host:" http://www.example.com
626 curl --header "Destination: http://nowhere" http://example.com
631 depending on what action to ask for. `-d` makes a POST, `-I` makes a HEAD and
632 so on. If you use the [`--request`](https://curl.se/docs/manpage.html#-X) /
633 `-X` option you can change the method keyword curl selects, but you do not
634 modify curl's behavior. This means that if you for example use -d "data" to
635 do a POST, you can modify the method to a `PROPFIND` with `-X` and curl still
637 simply adding `-X POST` in a command line like:
639 curl -X POST http://example.org/
649 problems so here's the executive run-down of how the vast majority of all
655 First, servers mostly use cookies to track the logged-in status of the
659 getting the login-form page to capture the cookies set there.
661 Some web-based login systems feature various amounts of JavaScript, and
669 In the actual `<form>` tag for the login, lots of sites fill-in
686 - Use the `--trace-ascii` option to store fully detailed logs of the requests
689 - Make sure you check for and use cookies when needed (both reading with
690 `--cookie` and writing with `--cookie-jar`)
692 - Set user-agent (with [`-A`](https://curl.se/docs/manpage.html#-A)) to
695 - Set referer (with [`-E`](https://curl.se/docs/manpage.html#-E)) like
698 - If you use POST, make sure you send all the fields and in the same order as
705 HTTPS).
709 received by the browser. (HTTPS forces you to use `SSLKEYLOGFILE` to do