Curl to return http status code along with the response

后端 未结 12 1155
我在风中等你
我在风中等你 2020-12-04 08:24

I use curl to get http headers to find http status code and also return response. I get the http headers with the command

curl -I http://localhost

12条回答
  •  天命终不由人
    2020-12-04 08:50

    The -i option is the one that you want:

    curl -i http://localhost
    

    -i, --include Include protocol headers in the output (H/F)

    Alternatively you can use the verbose option:

    curl -v http://localhost
    

    -v, --verbose Make the operation more talkative

提交回复
热议问题