回答
收藏
分享
举报
有什么方法可以查看网站支持哪些请求方法?
提问于2021-01-07 16:13

浏览 1.5k



比如说在nginx中配置 Allow-Methods和 Allow-Headers ,怎么知道网站支持哪些?

add_header Access-Control-Allow-Methods 'GET,POST';
add_header Access-Control-Allow-Headers '*';
add_header Access-Control-Allow-Credentials 'true';


# JD 可以看到 运行所有( Access-Control-Allow-Origin: *)

curl -I -XGET www.jd.com
HTTP/1.1 302 Moved Temporarily
Server: nginx
Date: Thu, 07 Jan 2021 08:09:52 GMT
Content-Type: text/html
Content-Length: 138
Connection: keep-alive
Location: https://www.jd.com/
Access-Control-Allow-Origin: *
Timing-Allow-Origin: *
X-Trace: 302-1610006992561-0-0-0-0-0
Strict-Transport-Security: max-age=360


#淘宝没显示

curl -I -XPUT www.taobao.com

HTTP/1.1 301 Moved Permanently
Server: Tengine
Date: Thu, 07 Jan 2021 08:11:31 GMT
Content-Type: text/html
Content-Length: 278
Connection: keep-alive
Location: https://www.taobao.com/
Via: cache10.cn2434[,0]
Timing-Allow-Origin: *
EagleId: 700f049e16100070914034934e


#  QQ也没显示

curl -I -XGET www.qq.com
HTTP/1.1 302 Moved Temporarily
Server: ias/1.3.5_1.17.3
Date: Thu, 07 Jan 2021 08:11:58 GMT
Content-Type: text/html
Content-Length: 149
Connection: keep-alive
Location: https://www.qq.com/

curl -I -XDELETE www.qq.com

HTTP/1.1 302 Moved Temporarily
Server: ias/1.3.5_1.17.3
Date: Thu, 07 Jan 2021 08:12:10 GMT
Content-Type: text/html
Content-Length: 149
Connection: keep-alive
Location: https://www.qq.com/


已修改于2022-12-31 04:42



写下您的回答
发表回答
全部回答(0)

按点赞数排序

按时间排序

提问者
wajika
这家伙很懒还未留下介绍~
0
文章
3
问答
0
粉丝
相关问答