Does the jQuery ajax call support PATCH?
Solution 1:
The $.ajax
method does support HTTP PATCH.
The problem you are seeing is that the ajax
method looks for PATCH in the Access-Control-Allow-Methods
response header of the options preflight check. Either this header is missing from your response, or the PATCH method was not included in the value of this header. In either case, the problem is in the server, not in your client-side code.
Here's an example using Java:
response.addHeader("Access-Control-Allow-Methods", "GET, POST, PATCH, PUT, DELETE");