Hi There,
Have anyone encounter issue with http.post to work perfectly fine on local browser i.e. ionic serve, However, the same code block returned 500 internal server error while running on ionic view app.
let headers = new Headers();
headers.append('Authorization', 'Client-ID xxxxxxxxxxxxxxx');
headers.append('Content-Type', 'application/json');
let options = new RequestOptions({ headers: headers });
let postParams = JSON.stringify({
image: base64Image,
type: 'base64'
});
this.http.post('https://api.imgur.com/3/image', postParams, options)
.map(res => res.json())
.subscribe(result => {
this.myStatus += "Sucess: OK";
}, error => {
this.myStatus += "Error: " + error;
});
Thanks,
dc