The image is not being posted to api in ionic

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.

  var uploadingImage = new Image();
  uploadingImage.src = "../assets/imgs/banana.jpg";
  let headers = new Headers();
  let url = '';
  let postData = JSON.stringify({
    key :'predimg',
    value :uploadingImage.src
  let data:Observable<any> =,postData)
  data.subscribe((result) => {

So what exactly is not working?

The code you posted uses a variable downloadingImage that doesn’t seem to exist.

yeah @Sujan12 i’ve changed that check that again.

The issue is the uploadingImage is not being taken by the POST API.

What does that mean? Does the server not know what to do with what it receives? Doesn’t it receive anything? Doesn’t the code POST anything? Is the variable even empty before you try to post?

it is not receiving the image i am sending through the application @Sujan12

So the variable is filled, the app is correctly sending it, but the server is not receiving the it?
Then this is a server bug and has nothing to do with Ionic.