Answer the question
In order to leave comments, you need to log in
What should be returned when calling the service with the OPTIONS method?
I read articles that you need to return methods supported by the service.
The method will work on a POST request.
By default, I plan to return that the method is not supported.
But what and in what form to return with the OPTIONS method?
switch ($_SERVER['REQUEST_METHOD']) {
case 'OPTIONS': break;
case 'POST': break;
default: break;
}
Answer the question
In order to leave comments, you need to log in
You can return anything.
You can even come up with your own method and also return something.
But the browser uses it to check cors headers , and it is advisable not to send anything else except for them
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question