when i call php rest api using http post in ionic 3 my code throw an error
"SyntaxError: Unexpected token s in JSON at position 0
** at JSON.parse ()**
** at XMLHttpRequest.onLoad (http://localhost:8100/build/vendor.js:74945:51)**
** at t.invokeTask (http://localhost:8100/build/polyfills.js:3:15660)**
** at Object.onInvokeTask (http://localhost:8100/build/vendor.js:5125:33)**
** at t.invokeTask (http://localhost:8100/build/polyfills.js:3:15581)**
** at r.runTask (http://localhost:8100/build/polyfills.js:3:10834)**
** at e.invokeTask [as invoke] (http://localhost:8100/build/polyfills.js:3:16794)**
** at p (http://localhost:8100/build/polyfills.js:2:27648)**
** at XMLHttpRequest.v (http://localhost:8100/build/polyfills.js:2:27893)"**
here is my code
placeorder(){
let orddata = {"userid":this.userid};
let sendData = {
"orderdata": orddata,
"orderdetail": this.cartpageitemdata
}
// this.senddata.push("orderdata",ord);
// this.senddata.push("orderdetail",this.cartpageitemdata);
this.service.post("http://localhost/smartvege/adminpanel/API/addorder.php?access_tocken=ae189b0987d4abc138197a175b488db5",sendData).then(data => {
console.log(data);
})
// console.log(sendData);
}