【问题标题】:command line curl with proxy and response status code带有代理和响应状态代码的命令行 curl
【发布时间】:2011-12-29 08:34:05
【问题描述】:

我正在尝试使用带有代理的命令行 CURL 获取响应状态代码。

这会返回整个页面,但我只想要状态码。我怎么做?谢谢。

curl -sL -w -x IP:PORT "%{http_code}\n" "http://www.example.com" -o /dev/null

【问题讨论】:

    标签: curl proxy


    【解决方案1】:

    你非常接近,-w 只是放错了位置。像这样使用它:

    curl -sL -x IP:PORT -w '%{http_code}\n' "http://www.example.com" -o /dev/null
    

    【讨论】:

      猜你喜欢
      • 2017-12-31
      • 1970-01-01
      • 1970-01-01
      • 2011-10-12
      • 2016-10-02
      • 1970-01-01
      • 2013-04-06
      • 2017-08-08
      • 1970-01-01
      相关资源
      最近更新 更多