REST CORS post no answers
Hi There,
Currently I'm trying to do a ajax call from a.domain.com (a website) to b.domain.com (nuxeo). In order to do this I extended the CORS with the following extension:
<?xml version="1.0"?>
<component name="nl.me.CORS-configuration">
<extension target="org.nuxeo.ecm.platform.web.common.requestcontroller.service.RequestControllerService" point="corsConfig">
<corsConfig name="CORS-API-CONFIG"
allowOrigin="https://a.domain.com https://b.domain.com"
allowSubdomains='true'>
<pattern>/nuxeo/api/v1/path/.*</pattern>
</corsConfig>
</extension>
</component>
The GET method works fine:
jQuery.ajax({
type: 'get',
url: 'https://dm.openworkplace.nl/nuxeo/api/v1/path/default-domain/@children',
crossDomain: true,
xhrFields: {
withCredentials: true
}
}
);
However the post method does not work from a.domain.com, it does work from b.domain.com (nuxeo instance). It does not return a answer at all…
jQuery.ajax({
type: 'POST',
contentType: "application/json",
dataType: "json",
url: 'https://b.domain.com/nuxeo/api/v1/path/default-domain',
data: '{"entity-type": "document", "name":"newDoc", "type": "File","properties": { "dc:title": "Specifications", "dc:description": "Created via a so cool and simple REST API", "common:icon": "/icons/file.gif", "common:icon-expanded": null, "common:size": null}}',
crossDomain: true,
xhrFields: {
withCredentials: true
});
The same command on the b.domain.com (with the nuxeo instance) works fine.
The server.log does not show anything.
Do you see if I'm doing anything wrong?
Thanks in advance, Bauke
0 votes
1 answers
2081 views
supportedMethods="GET, POST"
to the<corsConfig>
element?