Dec 21, 2011 at 2:13 AM
Edited Dec 21, 2011 at 2:15 AM
|Hi, good day everyone, im new in Web API and not sure is this the correct place to ask this question. How to enable CORS within Web API? im using preview 6. I
found following code from http://enable-cors.org/
<?xml version="1.0" encoding="utf-8"?>
<add name="Access-Control-Allow-Origin" value="*" />
Is that this simple? Is there any extra code needed in Web API itself?
CORS is controlled entirely by HTTP header. I'm not sure if its enough to add only that one? I've seen an example with these as well:
'Access-Control': 'allow <*>'
'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE'
'Access-Control-Allow-Headers': 'AUTHORIZATION, X-REQUESTED-WITH'