cURL / Mailing Lists / curl-users / Single Mail

curl-users

How to derive/capture the 301 url?

From: bruce <badouglas_at_gmail.com>
Date: Mon, 12 Sep 2016 12:37:38 -0400

Morn.

Simple (I hope question)..

I can do a basic curl
 curl -v -A "Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Firefox/45.0" --cookie-jar aa.lwp --cookie aa.lwp -L "
http://case.bncollege.com"

and I see the redirected url in the output stream... Short of crafting a
bash script/process. Is there an easier way to get the 301/redirected url.
In this case, the url is

.
.
.
< HTTP/1.1 301 Moved Permanently
< Location:
http://case.bncollege.com/webapp/wcs/stores/servlet/BNCBHomePage?storeId=16053&catalogId=10001&langId=-1
< Cache-Control: max-age=3600
< Expires: Mon, 12 Sep 2016 17:32:40 GMT
.
.
.

Is there a way to trigger off the "Location" in the returned headers?

thanks

-------------------------------------------------------------------
List admin: https://cool.haxx.se/list/listinfo/curl-users
FAQ: https://curl.haxx.se/docs/faq.html
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2016-09-12