Rest API do not work with POST statement (JavaScript)

Hi everyone,

i have a problem with my javaScript Code. I want to change the assignee of an task with following code:

 $.ajax({
    url: "http://localhost:8080/engine-rest/engine/default/task/46d069d2-89cb-11e8-951f-34f39a33b9d6/assignee",
    dataType: "JSON",
    type: 'POST',
    userId: "0",
    success: function (data) {
        console.log(data)
    }
});

But i get the error:

Quellübergreifende (Cross-Origin) Anfrage blockiert: Die Gleiche-Quelle-Regel verbietet das Lesen der externen Ressource auf http://localhost:8080/engine-rest/engine/default/task/46d069d2-89cb-11e8-951f-34f39a33b9d6/assignee. (Grund: CORS-Kopfzeile ‘Access-Control-Allow-Origin’ fehlt).

Normaly GET-statements are possible and i can change the assignee with “Chrome Rest Client”.

Best regards,
Frederik

Information:

I use Camunda EE 7.9.1 with tomcat.

Hi Fredo,

I recommend you make yourself familiar with the concept of Cross-Origin Resource Sharing (CORS). If you then want to grant access, see for example this thread: Enable CORS in Camunda Tomcat 7.4.

Cheers,
Thorben