curl -i 测试响应头和响应码
发布网友
发布时间:2022-12-14 06:03
我来回答
共1个回答
热心网友
时间:2024-03-31 06:31
curl -I
利用curl的-I(大写i)--head 选项仅查看响应头部信息:
[root@localhost ~]# curl -I http://192.168.1.101:8080/UFE/service/test
HTTP/1.1 405 Method Not Allowed
Server: Apache-Coyote/1.1
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: POST, GET, OPTIONS, DELETE
Access-Control-Max-Age: 3600
Access-Control-Allow-Headers: x-requested-with
Allow: GET
Content-Type: text/html;charset=utf-8
Content-Language: en
Content-Length: 1047
Date: Tue, 31 Mar 2015 11:31:42 GMT
curl -o 获取url的状态码
[root@localhost ~]# curl -o /dev/null -s -w %{http_code} http://192.168.1.101:8080/UFE/service/test
200