Hello guys, I’m trying to cal a web service with some paremters.
in home.ts file i’ve this list of params
var params = {
service: this.toBase64('register'),
device_id: this.toBase64(this.device.uuid),
org_name: this.toBase64(this.orgName),
org_email: this.toBase64(this.orgMail),
org_address: this.toBase64(this.orgAddress),
org_boardnumber: this.toBase64(this.boardNumber),
org_password: this.toBase64(this.password),
org_phone: this.toBase64(this.orgPhone)
}
this.regProvider.postRequest(params)
.subscribe(response => console.log(response))
there is method postRequest()
in Provider there is file register.ts. Here is method implementation.
postRequest(params) {
var headers = new Headers();
headers.append("Accept", 'application/json');
headers.append('Content-Type', 'application/json' );
headers.append('Access-Control-Allow-Origin', '*' );
let options = new RequestOptions({ headers: headers });
let jsonData = JSON.stringify(params)
return this.http.post(this.baseUrl, jsonData, options)
.map(response => response.json());
}
when i run application. this error appears
Can anyone help me where i made mistake.Thanks