对于iOS响应,我真的不明白我在这里做错了什么

时间:2018-02-23 08:02:06

标签: ionic3 angular4-router

    // service.ts//

      postRequest1(credentials, subUrl) {
        this.URL = this.apiUrl + subUrl;
         let headers = new Headers({
             'Content-Type': 'application/json',
             'Accept': 'application/json',
       'Access-control-allow-headers': 'Content-Type, Authorization, Content-Length, X-Requested-With',
   'Access-control-allow-methods' :'GET,PUT,POST,DELETE,OPTIONS',
   'Access-control-allow-origin': '*   ',
        });
        let options = new RequestOptions({ headers: headers });
        return new Promise((resolve, reject) => {
            this.http.post(this.URL, credentials, options)
                .map(res => res)
                .subscribe(res => {
                    resolve(res);
                }, (error) => {
                    reject(error);
                });
        });
    }

我面临错误Web服务-XMLHttpRequest由于访问控制checks.Response而无法加载(我的url)。如何消除此问题并获取post方法信息数据?此问题在Android中正常工作并在ios设备上出现错误。在iOS上提交后显示此错误

而且我,我面临一个类型thisXMLHttpRequest的错误无法加载[我的网址]。飞行前响应不成功

0 个答案:

没有答案