I am using Angularjs Chrome 35.0 and Firefox 30.0.
I need to make Rest requests to an API.
Every single request which have 200,201,404 (...) as response does work well.
Some of those responses with a 301 and a location header.
my javascript
this.folder = function(folder) {
var url = config.domain + '/' + folder.key;
var methods = resource(url, null, {
'move': {
method: 'PUT',
params: {
'move': ''
},
headers: {
'copy-source': '/path/to/' + folderKey
},
url: config.domain + '/path/to/' + newKey
}
});
and after the call (which does work), I have this error shown in the console :
XMLHttpRequest cannot load http://domain.com/path/to/folder?move=. The request was redirected to 'http://domain.com/path/to/folder', which is disallowed for cross-origin requests that require preflight.
EDIT
And I have an error status 0 and not really the 301. So it is impossible to deal with the response if I cannot make any difference bewteen a 301 and a 0 response...