curl 用法总结

curl -g -k --noproxy '*' -s -o /dev/null -w '%{http_code}' http://172.25.112.34/identity/v3

KSURL=https://github.com/bazelbuild/bazel/releases/latest

$ curl -Ls -w %{url_effective} -o /dev/null $KSURL
https://github.com/bazelbuild/bazel/releases/tag/0.16.1

 

$ curl -s -o /dev/null -I -w "HTTP_CODE: %{http_code}\nREDIRECT_URL: %{redirect_url}\n" $KSURL
HTTP_CODE: 302
REDIRECT_URL: https://github.com/bazelbuild/bazel/releases/tag/0.16.1

$ curl -w "%{url_effective}\n" -I -L -s -S $KSURL -o /dev/null
https://github.com/bazelbuild/bazel/releases/tag/0.16.1

 

get redirect url

posted @ 2018-06-12 17:39  lvmxh  阅读(462)  评论(0编辑  收藏  举报