Angular and CORS

China☆狼群 提交于 2019-12-01 23:33:31

You need to specify Access-Control-Allow-Origin: * on the server you are making the request to (i.e. the glassfish server), not the server hosting the page the request is coming from.

For Alice to access Bob's server, Bob has to grant permission. It would defeat the purpose if Alice could do it.

deploy your html file to the server you are running or set header Access-Control-Allow-Origin "http://localhost" to your web server configuration.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!