Answer the question
In order to leave comments, you need to log in
How to set up support for PUT and DELETE requests on a local Xampp server?
I am making a small API in php, I use XAMPP for the local server.
There are no problems with the POST and GET methods, but PUT and DELETE do not work - the request stops at OPTIONS.
Request headers contain
header("Access-Control-Allow-Orgin: *");
header("Access-Control-Allow-Methods: *");
I made a separate OPTIONS request to check which methods are allowed:
The result is the following:
It turns out that only POST, OPTIONS, HEAD, GET, TRACE are allowed on the server.
Added the following settings to httpd.conf on the server:
No result, only POST, OPTIONS, HEAD, GET, TRACE methods remain available.
I've been trying to figure this out for a few days now, I'm asking for help.
Answer the question
In order to leave comments, you need to log in
And actually what is the problem?
Apache config has a list of allowed trees.
Add it there and that's it.
REST - bottom) Don't listen to the hipsters. And forget about it.
Well, in general, it is very similar to the fact that the legs with CORS go.
The Cross-Origin Resource Sharing standard works by adding new HTTP headers that allow servers to describe the set of origins that are allowed to read the information requested by a web browser. In particular, for HTTP request methods that can cause side effects on server data (in particular, for HTTP methods other than GET or for POST requests using certain MIME types), the specification requires browsers to "prevalidate" the request , requesting the supporting methods from the server using the OPTIONS HTTP request method and then, on top of the "confirmation" from the server, sending the actual request with the actual HTTP request method
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question