Question

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

Was it helpful?

Solution

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.

OTHER TIPS

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top