I am using Angularjs Chrome 35.0 and Firefox 30.0.
I need to make Rest requests to an API.
Some of those finishes by /
like : http://mydomain.com/path/to/folder/
It won't work without this / and I don't have the hand on the API.
To do this I use un service using resource :
this.folder = function(folderKey) {
var methods = resource(url, null, {
'create': {
method: 'PUT',
url: config.domain + folderPath + '\\/'
}
});
return methods;
};
If I only put /
or \/
, angular doesn't keep the ending /
while doing the request.
The '\\/'
is the only way i found to keep it.
It does work well in chrome but in firefox it does make this url which obviously doesn't work : http://mydomain.com/path/to/folder%5C