Skip to content
This repository has been archived by the owner on Dec 1, 2023. It is now read-only.

Cross-Origin Request #22

Closed
raleePixel opened this issue Jul 16, 2015 · 2 comments
Closed

Cross-Origin Request #22

raleePixel opened this issue Jul 16, 2015 · 2 comments

Comments

@raleePixel
Copy link

Hi,

Does anyone knows how to do a http:post via Vue-resource from a different domain?

Thanks in advanced!

Cheers
Ralee

@steffans
Copy link
Member

You can do it with a normal post $http.post('http://domain.com/'), however the domain must support CORS. See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS

@kenberkeley
Copy link

  • Backend server should set Access-Control-Allow-Origin to * or [ Frontend server domains whitelist ]
  • Vue.http.options.xhr = { withCredentials: true } is not needed.
  • url must begin with http(s)://. e.g. localhost:8080 would fail.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants