制作一个HTTP请求到Azure从asp.net网站的移动服务 [英] Making a HTTP request to Azure mobile services from asp.net web site
问题描述
NET的网站,并在蔚蓝的移动服务。他们不是在同一个领域,因此我得到以下错误:
NET web site and a mobile service on azure. They're not on the same domains and hence i get the following error:
未能加载资源:没有访问控制允许来源标头的请求的资源present。因此,原产地是不允许访问。
Failed to load resource: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin is therefore not allowed access.
不过,我编辑的网络配置文件在这篇文章中建议:
http://encosia.com/using-cors-访问的-ASP净服务 - 跨域/
However, I edited the web config file as recommended in this article: http://encosia.com/using-cors-to-access-asp-net-services-across-domains/
和我说:
<system.webServer>
<httpProtocol>
<customHeaders>
<add name="Access-Control-Allow-Origin" value="*" />
<add name="Access-Control-Allow-Headers" value="Content-Type" />
</customHeaders>
</httpProtocol>
</system.webServer>
然而,它仍然是示出错误。难道这应该是做不同,当涉及到Azure和消费网站内的移动服务?
However, It still is showing errors. Is this supposed to be done differently when it comes to Azure and consuming a mobile service within the site?
推荐答案
您是否启用移动服务CORS?你可以在这里看到的解释(搜索CORS)的http://www.windowsazure.com/en-us/documentation/articles/mobile-services-html-get-started/
Did you enable CORS for the mobile service? You can see an explanation here (search for CORS): http://www.windowsazure.com/en-us/documentation/articles/mobile-services-html-get-started/
希望这有助于
亨里克
这篇关于制作一个HTTP请求到Azure从asp.net网站的移动服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!