I've encountered an issue where I am unable to make an AJAX POST Request from my iOS (Cordova) App. The API URL has a secure certificate on www.myDomain.ch but not without the www prefix. Interestingly, when I tested the Request with a tool or in a React test application, it worked perfectly fine. However, when attempting to make the same request from my iOS App, it consistently results in a 403 error. I have experimented with different libraries such as jQuery Ajax, fetch, and axios, but the problem persists. Additionally, the Backend has CORS enabled.
Here is an example of how my AJAX call looks like:
$.ajax({
url: 'myurl',
data: JSON.stringify(dataObject),
method: 'POST',
dataType: 'json',
success: function(data) {
console.log('success', data);
},
error: function(err) {
console.log('error', err);
}
});
I am curious whether iOS requires a special HTTPS certificate or if there is something specific that needs to be added in the Request Header for this request to work properly?