How to handle OPTIONS requests in the background

clipboard.png

headers: "Content-Type": "application/json"
"/getProjectsByUserId"
POSTheaders: "Content-Type": "application/json",
POSTOPTIONS
/getProjectsByUserIdOPTIONS
RESTEASY003655: No resource method found for options, return OK with Allow header
500

clipboard.png

OPTIONS200.OPTIONSPOST

springfilterhttp://www.mamicode.com/info-...

clipboard.png

is there anything else I can do? no, no, no.

Mar.13,2021

this is a cross-domain problem. The pre-check request OPTIONS returns 200 No problem. In addition, your API is used to handle POST , so you not only need to handle OPTIONS , but also support POST processing


OPTION request.
should be in filter to verify whether


I use filter on the Internet. The weird thing about
is that I need @ Order (1) to set the highest filter priority to take effect.


option is a pre-request, cross-domain or complex request, the browser will automatically initiate a pre-request, you can set the cache time of options

// 20
header('Access-Control-Max-Age: 1728000');
Menu