I've got two servers, both of which I control. One is a thingworx server that talks to the other, a windchill server, and displays my web page. I've got a thingworx mashup that talks to the windchill server. It pulls images and pdf from the windchill server and allows the operator of the mashup to alter the image or pdf then put it back on the server. I tackled the CORS problem presented when pulling images from the server but now I'm getting CORS errors when POSTing to the server.
I tried putting the CORS filter on the thingworx server but no joy. I had to tell the script to pull the images as crossorigin, so I'm thinking there's some proper way to ask for a crossorigin POST too.
$.ajax({
method: 'POST',
url: urlString,
enctype: 'multipart/form-data',
processData: false,
cache: false,
contentType: false,
processData: false,
type: 'POST',
data: fd
//crossOrigin: true
}).done(function(data) {
console.log('success', data)
});
Works great with CORS checking turned off in chrome.