Discussion:
I need to get the redirect url without downloading the url
Add Reply
ToddAndMargo
2018-08-05 20:51:31 UTC
Reply
Permalink
Raw Message
Hi All,

There are times when I need the redirect url(s)

curl -Ls -w %{url_effective} -o /dev/null https://google.com

does give the redirect, but it downloads the file as well
(sends it to dev nul). This is not practical when the
downloaded file is multiple megabytes long.

Is there a way to get curl to give me just the redirect(s)?

Many thanks,
-T

-----------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users
Etiquette: https://curl.haxx.se
Daniel Stenberg
2018-08-05 22:43:52 UTC
Reply
Permalink
Raw Message
Post by ToddAndMargo
There are times when I need the redirect url(s)
curl -Ls -w %{url_effective} -o /dev/null https://google.com
Is there a way to get curl to give me just the redirect(s)?
Add -I (--head) ?
--
/ daniel.haxx.se
-----------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users
Etiquette: h
ToddAndMargo
2018-08-05 23:25:40 UTC
Reply
Permalink
Raw Message
Post by Daniel Stenberg
Post by ToddAndMargo
There are times when I need the redirect url(s)
   curl -Ls -w %{url_effective} -o /dev/null https://google.com
Is there a way to get curl to give me just the redirect(s)?
Add -I (--head) ?
Hmmmm. That give me what I want and a lot of other
interesting stuff too.

Thank you!



-----------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users
Etiquette: https://curl.haxx.se/mail/etiquette.htm

Loading...