I can't seem to find a simple example of correctly using CORS in conjunction with WKWebview for Ionic 2 on iOS.
Here's the code I'm using, which was previously working on UIWebview:
let headers = new Headers();
headers.append('Content-Type', "application/json");
var url = "https://myawssigningurlexample.com/1234";
var params = JSON.stringify({
someObj: 'blah'
});
return this._http.post(url, params, { headers: headers })
.map(res => res.json())
.catch((error: any) => {
return Observable.throw(error);
});
The doc here doesn't actually provide an example, but says you need to do it: http://ionicframework.com/docs/wkwebview/#cors
Q) Please can someone provide a simple example of how to do it?