I am posting a request and I am suppose to receive a 'success' string back as response. I am getting an HttpResponseError with the following information posted in the image below.
PurchaseOrderService
postPurchaseOrderCustom(purchaseOrderCustom: PurchaseOrderSaveCustom) {
const url = `${this.localUrl}purchaseOrderCustom`;
return this.http.post<String>(url, purchaseOrderCustom, {headers: this.header})
.pipe(
catchError(this.handleError('postPurchaseOrderCustom', 'I am an error'))
);
}
PurchaseOrderComponent
this.purchaseOrderService.postPurchaseOrderCustom(purchaseOrderCustom).subscribe( response => {
console.log("Testing", response);
},
error => {
console.error('errorMsg',error );
}
The way I am doing it is the same way its done in the documentation. Do point out to me what I am doing wrong.