所请求的资源上没有"Access-Control-Allow-Origin"标头.来自移动服务 [英] No 'Access-Control-Allow-Origin' header is present on the requested resource. from mobile services
问题描述
我从azure移动模板创建了一个简单的Vanilla ToDo,以测试服务,但似乎无法正常工作.我可以使用移动服务从本地主机连接到 https://phonegapwil.azure-mobile.net ,但是不能我发布了网站 http://phonegapwil.azurewebsites.net/
I created a simple vanilla ToDo from azure mobile template to test the service but don't seem to work correctly. I can connect to https://phonegapwil.azure-mobile.net from localhost with mobile services but not after I published site, http://phonegapwil.azurewebsites.net/
错误消息: XMLHttpRequest无法加载 https://phonegapwil.azure-mobile.net/tables/todoitem ? $ filter =(complete%20eq%20false).所请求的资源上没有"Access-Control-Allow-Origin"标头.因此,不允许访问来源" http://phonegapwil.azurewebsites.net .响应的HTTP状态代码为400.
error message I get: XMLHttpRequest cannot load https://phonegapwil.azure-mobile.net/tables/todoitem?$filter=(complete%20eq%20false). No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://phonegapwil.azurewebsites.net' is therefore not allowed access. The response had HTTP status code 400.
我也为CORS尝试了"*",但没有成功.
I also tried "*" for the CORS but no go.
有什么想法吗?谢谢
推荐答案
感谢您的回复@phillipv.我使用了"*",但仍然无法正常工作.我使用.net作为我的移动服务后端,这就是问题所在.好像他们有一个错误.我使用节点后端重新创建了该文件,并且没有任何问题.
Thanks for your reply @phillipv. I used "*" but still didn't work. I used .net as my mobile service back-end and that was the problem. Seems like they have a bug. I recreated this using node back-end and worked without an issue.
来自Microsoft
come on Microsoft
我在这里看到了一个小问题 不与Azure移动服务.net后端配合使用
I saw a nuget fix here cors not working with azure mobile service .net backend
这篇关于所请求的资源上没有"Access-Control-Allow-Origin"标头.来自移动服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!