Hi,
We are having a problem by getting an empty POST data on our API.
We are loading our application using WKWebKit. Inside our application, it sends a POST request to the third-party API with a data that has Content-Type: application/x-www-form-urlencoded.
We've also added the necessary headers in the third-party application for CORS:
It was reflected in headers during the request as well as the params data from the AJAX request.
However, upon checking the request data in the third-party API, we found out that it was empty.
We are also encountering an error log of:
Origin myapplicationURL is not allowed by Access-Control-Allow-Origin.
We are not encountering this error in IOS Safari. Was there anything we might have missed?
We are having a problem by getting an empty POST data on our API.
We are loading our application using WKWebKit. Inside our application, it sends a POST request to the third-party API with a data that has Content-Type: application/x-www-form-urlencoded.
Code Block javascript $.ajax({ method: 'POST', url: thirdpartyURL + '/getData', data: 'params=' + JSON.stringify(params), success: function (e) { console.log(e) })}
We've also added the necessary headers in the third-party application for CORS:
Code Block php$response->header('Access-Control-Allow-Origin', '*');$response->header('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS');
It was reflected in headers during the request as well as the params data from the AJAX request.
However, upon checking the request data in the third-party API, we found out that it was empty.
We are also encountering an error log of:
Origin myapplicationURL is not allowed by Access-Control-Allow-Origin.
We are not encountering this error in IOS Safari. Was there anything we might have missed?