I am using jersey as my restful api implementation. In the front end, I am using angularjs $http service to make http request. When I request a delete method I always got be
Try using the CORS extension for chrome, it helped me once.
EDIT
This happens because angular adds X-Header keys in your request headers.
X-Headers generally define or set the operating parameters for the HTTP req/res
You can fix this by modifying the Content-Type of your requests to "text/plain" or "application/x-www-form-urlencoded" or "multipart/form-data".
You can do this by using an interceptor while in your app config.
EDIT
Add this to your server code -
header('Access-Control-Allow-Headers: X-Requested-With');
Try changing the content-type to text/plain
Hope this helps.
After some testing, I found the solution. I put the allow method on the header as below, then it works. I don't know why "*" doesn't work.
headers.add("Access-Control-Allow-Methods", "GET, POST, OPTIONS, PUT, DELETE");