So I have been using CORS for a short time now, I just read up on how it works behind the scenes.
My question is how does the browser know when to do a pre-flight request?
There is no issue involved right now, as the browser seems to be working fine, I am just a little bit curious. Because when I make the request, I am not giving it any information on whether or not it is CORS, yet it still knows to do a pre-flight.
So I have been using CORS for a short time now, I just read up on how it works behind the scenes.
My question is how does the browser know when to do a pre-flight request?
There is no issue involved right now, as the browser seems to be working fine, I am just a little bit curious. Because when I make the request, I am not giving it any information on whether or not it is CORS, yet it still knows to do a pre-flight.
Share Improve this question asked Jun 17, 2015 at 17:12 Qasim AhmedQasim Ahmed 1972 silver badges10 bronze badges1 Answer
Reset to default 7The browser will send a preflight request if:
- You add custom headers to your request
- You use a method other than GET, HEAD or POST
- You use POST with an unusual Content-Type.
More details here: HTTP access control (CORS), Preflighted requests
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745095551a4610955.html
评论列表(0条)