I am using closure library to do a simple POST. I think XhrIo should work because from my machine when I use any other rest client ,like Firefox browser app RESTClient or Chrome's Simple Rest Client , I can make POST request to the server and content type is application/json.
But from my application I am unable to make a post.
I am using the following code
xhr = new goog.net.XhrIo;
When you add a header to an XHR object, most browsers will do a preflight request, which is the
OPTIONS method that you are seeing. There is not a way to circumvent this if you are adding custom headers, unfortunately. The
POST will be sent after the
If you have specific issues with the
OPTIONS request you should edit your question to include them; otherwise, this is expected behavior.