Can't use "Options" in Post Call - Is there a way around this?


I’m getting the following message (on the server side) when I do a post in Ionic 2:

Authentication method not supported: OPTIONS.

the call I’m using is:'', body, options)

Is there a way to pass my headers into the post call without using the options parameter, or am I missing something?

Any help would be appreciated!


OPTIONS is the request method in this case.

For security reasons (“CORS” is the term to google) the browser sometimes does this “preflight request” first before he actually contacts the real URL:

You will have to implement this OPTIONS request in your backend.

I don’t have any control of the backend - How can I work around this? Is there a way to send the headers that doesn’t require an OPTIONS call?

Contact whoever does have control of the backend, especially if they’re claiming to be providing security testing services, and tell them that they need to implement CORS properly.

No, but you can proxy these requests through your own server where you take care of the headers. That’s not the right solution, but it works. If you google for “CORS proxy” you might find ready made software or even hosted ones for development.