CORS Problems

Hello everyone,
I’m trying to implement an ajax http request, but i’m heaving CORS issues with both Ionic Server and IOS.

Request method:

sendPostRequest(json, url) {

    var response;
    var headers = new Headers();
    headers.append('Content-Type', 'application/json');
    headers.append('Access-Control-Allow-Origin', '*');
    headers.append('Access-Control-Allow-Methods', 'GET,POST,PUT,DELETE,OPTIONS');
    headers.append('Access-Control-Allow-Headers', 'Content-Type');''+url, JSON.stringify(json), {headers:headers})
    .map((res:Response) => res.json())
        data => console.log(data),
        err => console.error(err),
        () => console.log('done')

Can anyone help me plz? I’d be grateful.

Easiest way for me is to use this nodejs corsproxy module. :slight_smile:

Ty for your answer, and what about IOS and Android, do you have any idea how to deal with it?