如何在我的Dev Tools网络上过滤(隐藏)飞行前请求

时间:2016-02-23 02:15:56

标签: cors google-chrome-devtools

通常会显示两个来电,飞行前和实际请求。这有时很烦人。有没有办法隐藏飞行前请求?

或者是否有基于标题过滤某些请求的插件?

2 个答案:

答案 0 :(得分:192)

The quickest way to do this is to filter on -method:OPTIONS.

enter image description here

Explanation: all pre-flight requests are via the HTTP OPTIONS method (opposed to POST or GET). This filter says "not method OPTIONS".

Note the leading hyphen because if you forget it, you'll only show pre-flight requests.

答案 1 :(得分:1)

默认情况下,“所有”请求将显示在“网络”标签中。要查看OPTIONS请求,可以选择“其他”。要仅查看您的Web API请求,可以选择“ XHR”(不会显示OPTIONS请求)。

enter image description here