The curl command:
curl -IL "http://www.bbc.co.uk"
returns:
HTTP/1.1 301 Moved Permanently
Server: nginx
X-BBC-No-Scheme-Rewrite: 1
X-Cache-Action: HIT
X-Cache-Hits: 18686
Vary: X-BBC-Edge-Scheme
Cache-Control: public, max-age=3600
X-Cache-Age: 2624
Content-Type: text/html
Date: Thu, 02 Nov 2017 16:55:53 GMT
Location: https://www.bbc.co.uk/
Content-Length: 178
Connection: Keep-Alive
HTTP/1.1 200 OK
Content-Type: text/html; charset=utf-8
ETag: W/"3fdf4-XNfGeb/Aqcmv8OYZKVQdoUFYC34"
X-Frame-Options: SAMEORIGIN
Content-Length: 261620
Date: Thu, 02 Nov 2017 16:55:53 GMT
Connection: keep-alive
Set-Cookie: BBC-UID=65699f7bb41e91e9d7e103d8618f7780367bf9e637843476ca70678244f407000curl/7.19.7%20(x86_64-redhat-linux-gnu)%20libcurl/7.19.7%20NSS/3.19.1%20Basic%20ECC%20zlib/1.2.3%20libidn/1.18%20libssh2/1.4.2; expires=Mon, 01-Nov-21 16:55:53 GMT; path=/; domain=.bbc.co.uk
X-Cache-Action: HIT
X-Cache-Hits: 5
X-Cache-Age: 0
Cache-Control: private, max-age=0, must-revalidate
Vary: Accept-Encoding, X-CDN, X-BBC-Edge-Scheme
(In production, I use -i
and not -I
to get the whole payload)
How do I get curl to hide the preceding header(s) that issue the redirect, and just return the header of the final target resource?