Cross domain POST Request Cross domain POST requests supports only below content types and other content type are not allowed by default. application/x-www-form-urlencoded multipart/form-data text/plain So, if we try to make an ajax request to such POST URLs with XML or JSON content type, it will not be able to make request and give CORS error. Allowing Cross domain POST request with JSON or XML Content-Type We have our service implemented in Java and we will use Servlet Filter & request wrapper to build our solution. Please see my below POST to see how to implement CORS using java servlets which works well with GET methods or allowed content types with POST method. https://www.thetechnojournals.com/2020/03/cors-implementation-using-java-filter.html In this POST I will explain only additional things required for our problem with POST request, so I request you to go through the above link first. Request wrapper to change/ override the content-type to JSON or XML ...
Blogs about Java, J2ee, Multithreading, Data structure, Algorithm, Spring framework, Spring boot, Web services and open source technologies