No 'Access-Control-Allow-Origin' header is present on the requested resource. from mobile services

爱⌒轻易说出口 提交于 2019-12-25 03:34:17

问题


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/

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.

I also tried "*" for the CORS but no go.

Any ideas? Thanks


回答1:


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.

come on Microsoft

I saw a nuget fix here cors not working with azure mobile service .net backend



来源:https://stackoverflow.com/questions/26870273/no-access-control-allow-origin-header-is-present-on-the-requested-resource-fr

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