I am currently working on an http request using the Ionic Native HTTP plugin, but I encountered the following error:
Error[ts] Expected 0-2 arguments, but got 3.
Here is the specific Http call that I am trying to make:
getAcknowledgmentRequest(ssoId, alertType) {
var url = this.globals.getUrl() + "receive_orderM";
var body = JSON.stringify({ sso_id: ssoId, alert_type: alertType });
let bearer = 'Bearer ' + this.globals.getAccess();
let headers = { 'Accept': 'application/json' , 'Authorization': bearer };
return this.http.post(url,body,headers).then(
(resp: HTTPResponse) => {
return resp.data;
})
.catch((error: any) => {
console.log(error);
});
}
Additionally, here is the method where I call my service:
this.messageService.getAcknowledgmentRequest(sso_id,alertType).then(
(response: any) =>{
this.responseData = data;
this.orders = this.responseData ;
if (this.orders.length == 0) {
this.showMessage = true;
}
loading.dismiss();
})
.catch(error => {
Console.log(error);
})