Difference between revisions of "Curl --head (-I)"

From wikieduonline
Jump to navigation Jump to search
m (Brave moved page Curl -I to Curl --head (-I))
 
(2 intermediate revisions by one other user not shown)
Line 7: Line 7:
  
 
== Examples ==
 
== Examples ==
  [[curl]] -I https://google.com
+
 
[[HTTP/2]] 301
+
  {{curl google}}
[[location]]: https://www.google.com/
 
[[content-type]]: [[text/html]]; charset=[[UTF-8]]
 
date: Wed, 13 Oct 2021 10:22:25 GMT
 
expires: Wed, 13 Oct 2021 10:22:25 GMT
 
cache-control: private, max-age=2592000
 
server: gws
 
content-length: 220
 
x-[[xss]]-protection: 0
 
x-frame-options: SAMEORIGIN
 
[[set-cookie]]: CONSENT=PENDING+234; expires=Fri, 01-Jan-2038 00:00:00 GMT; path=/; domain=.google.com; Secure
 
p3p: CP="This is not a P3P policy! See g.co/p3phelp for more info."
 
alt-svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-
 
Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
 
  
 
  [[curl -I --http2]] https://google.com
 
  [[curl -I --http2]] https://google.com
Line 44: Line 31:
 
== Related ==
 
== Related ==
 
  [[curl -Is]] https://yourdomain.com | [[head -1]]
 
  [[curl -Is]] https://yourdomain.com | [[head -1]]
 +
<code>[[curl -k]]</code> or <code>[[curl --insecure]]</code>
  
 
== See also ==
 
== See also ==
 
* {{curl}}
 
* {{curl}}
 +
* {{HTTPS}}
  
 
[[Category:cURL]]
 
[[Category:cURL]]

Latest revision as of 14:14, 11 December 2023

-I, --head Show document info only
curl -I
curl -Is
-i, --include       Include protocol response headers in the output

Examples[edit]

 curl -I https://google.com
HTTP/2 301
location: https://www.google.com/
content-type: text/html; charset=UTF-8
date: Wed, 13 Oct 2021 10:22:25 GMT
expires: Wed, 13 Oct 2021 10:22:25 GMT
cache-control: private, max-age=2592000
server: gws
content-length: 220
x-xss-protection: 0
x-frame-options: SAMEORIGIN
set-cookie: CONSENT=PENDING+234; expires=Fri, 01-Jan-2038 00:00:00 GMT; path=/; domain=.google.com; Secure
p3p: CP="This is not a P3P policy! See g.co/p3phelp for more info."
alt-svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3- 
Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
curl -I --http2 https://google.com
HTTP/2 301
location: https://www.google.com/
content-type: text/html; charset=UTF-8
date: Wed, 13 Oct 2021 10:31:33 GMT
expires: Wed, 13 Oct 2021 10:31:33 GMT
cache-control: private, max-age=2592000
server: gws
content-length: 220
x-xss-protection: 0
x-frame-options: SAMEORIGIN
set-cookie: CONSENT=PENDING+087; expires=Fri, 01-Jan-2038 00:00:00 GMT; path=/; domain=.google.com; Secure
p3p: CP="This is not a P3P policy! See g.co/p3phelp for more info."
alt-svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3- 
Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
curl -Is https://google.com | head -1
HTTP/2 301

Related[edit]

curl -Is https://yourdomain.com | head -1
curl -k or curl --insecure

See also[edit]

Advertising: