Sunday, December 2, 2018

curl - fetch headers of URL

To fetch only the headers of a HTTP URL, we can use the curl with the -I switch. Consider the following command line:


HTTP/2 200 
server: nginx
date: Sun, 02 Dec 2018 10:09:19 GMT
content-type: text/html; charset=UTF-8
set-cookie: wordpress_google_apps_login=3612792336cb3b1361acd56bb0addf07; path=/; secure
link: <https://www.stanford.edu/wp-json/>; rel="https://api.w.org/"
link: <https://www.stanford.edu/>; rel=shortlink
x-frame-options: SAMEORIGIN
vary: Accept-Encoding
wpe-backend: apache
x-wpe-loopback-upstream-addr: 127.0.0.1:6783
x-cacheable: NO:Set Known Cookie
cache-control: max-age=0, must-revalidate, private
x-cache: MISS
x-pass-why: 
x-cache-group: normal
x-type: default



In this we fetch the headers sent from the URL of the stanford university. 

No comments:

Post a Comment