I am working on jaydata as client and .net odata as server but when i request Server it gives me error of 501 not implemented and when i search out for it the issue was CORS [Cross Origion Resouse Sharing] is there any way to enable CORS on odata server or IIS ???

my code is simple just create context with service and fetch entites one solution was to put specail config section in web.config

 <httpProtocol>
     <customHeaders>
      <add name="Access-Control-Allow-Origin" value="*" />
    </customHeaders>
 </httpProtocol>

But this does not solve the issue

My Chrome View During the process

Remember i am using odata [RESTFUL] service and jaydata as client

有帮助吗?

解决方案

This is because nothing handles the OPTIONS preflight requests. You'll want to intercept them. See this question on how to do that and a few important notes.

Update: The question I linked assumes a WCF Data Services implementation. If you're using something else, you'll have to edit your question or search for implementation-specific methods yourself.

其他提示

Use chrome dev tools or firebug or fiddler to see what is happening on the wire. Which browser do you use? Old IE can not handle CORS

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top