How to filter (hide) Pre-flight requests on my Dev Tools Network

CorsGoogle Chrome-Devtools

Cors Problem Overview


Normally both calls are shown, the pre-flight and the actual request. This is sometimes annoying. Is there a way to hide the pre-flights requests ?

Or is there a plugin to filter certain requests based on headers ?

Cors Solutions


Solution 1 - Cors

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.

Solution 2 - Cors

By default "All" requests will be displayed in network tab. To see OPTIONS requests, you can select "Other". To see only your web api requests, you can select "XHR" (which wont show OPTIONS request).

enter image description here

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJohn SmithView Question on Stackoverflow
Solution 1 - CorsRick Hanlon IIView Answer on Stackoverflow
Solution 2 - CorsChiragView Answer on Stackoverflow