I have done some research and seems like this isn't possible, so I figured I would ask.
I am doing a rest GET call to see if a folder exists, if it doesn't I create a new folder, if it does then I use that folder.
Anyway, I am taking advantage of this for this specific function, so to me it's not really an error, but would obviously return a 404 not found error if the folder doesn't exist.
Is it possible to add anything inside of my code to not return this error?
try {
$.ajax({
url: serverUrl+"/_api/Web/GetFolderByServerRelativeUrl('"+serverRelativeUrlToFolder+"')",
type: "GET",
headers: { "accept": "application/json;odata=verbose" },
async: false,
success: function(data)
{ // if the call was successfull, then the folder must already exist
returnValue = true;
},
error: function(data)
{
returnValue = false;
}
});
console returns
jquery.min.js:4 GET myurlhere 404 (Not Found)