In your CorsMethod configuration, try changing OPTION to OPTIONS? In my test with OPTION I got a message about "No 'Access=Control-Allow-Origin' header..." as well, although I got 400 instead of 500 error. If it doesn't help, a screenshot of the error message in the developer tools console in your browser would be helpful.
Nothing changed, unfortunatly.
The error is in french but the closest translation I could find was
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at [url]. This can be fixed by moving the resource to the same domain or enabling CORS.
It also tell me it's because the header Access-Control-Allow-Origin is missing.
But as far as I can tell, I've already enabled CORS, and the API should send the correct header.
I'm working on Firefox and here's the message in Chrome:
Failed to load<url>: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access. The response had HTTP status code 400.
Note that the status code is 400 instead of 500 on Chrome.
I have resolved my issue.
By using jquery $.post() the request is accepted. However, I need to put "Json" as the datatype.
So the correct request would be: $.post(url, value, functionOnSucess(), "Json"). It's exactly the same thing for get request: $.get(url, functionOnSuccess(), "Json").