Http.post sending data

Hello …I’m trying to send a number as OTP to a mobile number. OK I’ll be explaining the situation screen by screen.

  1. In first screen I have a ion-input field for mobile number and a button to send OTP to that mobile number entered.
  2. By that button click I’m trying to use http.post() method to send a number(OTP) to the entered mobile number by using third party url(For sending SMS).

Here what I’m getting is: Everytime http.post() method is going to .catch(error =>{}) block only. I don’t know why…
But here I have url. But I don’t know what to insert as body and header. Let me know what to insert in place of body and header in my case please.
Thank You in advance

Might be more helpful if you shared the code you are using.
Also in the catch block - console.log(error) will probably give you some indication of what’s happening.

yes @beck24. But error status is showing as undefined.And error message, error headers are also showing undefined

ok, so let’s see your code… otherwise nobody can really help you. Without seeing what you’re working with the best you’ll get is a bunch of “maybe” guesses, but more probably your question will be ignored.

1 Like

Thank you @beck24. It’s working fine in android device… Till now I just tested it in browser. So now again it is showing error in browser. Bt in device it’s working perfectly

Sounds CORS-y to me.