I’m working on the ionic application which uses POST API. And I am feeding that POST API with an image/blob but not taking that image into it. If the api took the image then it’ll return a string as an output and it should be visible in the HomePage in ionic.
Here is the code.
givetoapi(){
var uploadingImage = new Image();
uploadingImage.src = "../assets/imgs/banana.jpg";
let headers = new Headers();
headers.append('content-type','image/*');
let url = 'http://af46cff3.ngrok.io';
let postData = JSON.stringify({
key :'predimg',
value :downloadingImage.src
})
let data:Observable<any> = this.http.post(url,postData)
data.subscribe((result) => {
console.log(result)