hey , are you sure app works in android because platform does not matter for get or post method.
if you are running on app in browser it will not work because of CORS(control access origin) . for that you have to add CORS extension in particular browser.
for the post method you have to pass headers for authentication such as token no .
here is my code
const httpOptions = {
headers: new HttpHeaders({
‘Content-Type’: ‘application/json’,
‘Authorization’: ‘token’
})
};
this.http.post( url, data, httpOptions)
.subscribe(data => {
this.data = data;
resolve(this.data);
},
error => {
// probably a bad url or 404
reject(error);
this.handleError(error)
})
}); // end Promise