Vue-resource: why the request method is OPTIONS ?

Created on 2 Mar 2016  路  3Comments  路  Source: pagekit/vue-resource

issues:44
issues:47

someone says:
OPTIONS is always fired first if you're not sending requests to the same domain, so if you're server is not handling OPTIONS or doesn't have proper allow origin settings there, the GET/POST will never be sent.
It's not a bug, it's how CORS works. You would see the same thing if using angular/react or any other AJAX framework.

but on my Node.js server. I put my server set to open cdn. it does not work.

my Node server on port 4000,i use webpack on port 8080

whatever.it will have a OPTIONS method request .

how can i resolve it?

Thanks!

Most helpful comment

The OPTIONS request is part of the of the CORS spec. They are not happening when your request meets the requirements of a _Simple request_, please see https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS#Simple_requests

All 3 comments

2 1
1 1

The OPTIONS request is part of the of the CORS spec. They are not happening when your request meets the requirements of a _Simple request_, please see https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS#Simple_requests

Thanks.
Through this issues I have learned a lot

Was this page helpful?
0 / 5 - 0 ratings