Using -l
or --location
one can follow redirects using cURL. Let’s understand it with a real-world example.
curl -L https://sd.minilyst.com
- Initial URL was
https://sd.minilyst.com
. - Scrapingdog issues a
301
redirect with theLocation
header pointing tohttps://sd.minilyst.com
. - Final URL is
https://sd.minilyst.com
.
If you need HTTP headers in the output then you can use -i
option of cURL.
curl -L -i https://sd.minilyst.com
