2

I'm trying to handle CORS in WCF Restful service. After going through a lot of googling, I still cannot find solution. I've attached the fiddler results below. What headers am I missing here.

Request Headers
OPTIONS /EconomicAtlas/dp/e96b1857-e5c7-40b1-af30-502f450d1b06 HTTP/1.1
Host: localhost:8089
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Origin: http://localhost
Access-Control-Request-Method: GET
Access-Control-Request-Headers: authorization,content-type
Connection: keep-alive


Response Headers
HTTP/1.1 405 Method Not Allowed
Allow: GET
Content-Length: 1565
Content-Type: text/html; charset=UTF-8
Server: Microsoft-HTTPAPI/2.0
Access-Control-Allow-Headers: Accept, Content-Type, Authorization
Access-Control-Allow-Methods: POST, GET, PUT, DELETE, OPTIONS
Access-Control-Allow-Origin: *
Date: Sun, 18 Oct 2015 08:41:21 GMT
Mazolo
  • 307
  • 4
  • 19
  • 1
    have you tried this with a hostname instead of localhost ? – Marged Oct 18 '15 at 09:54
  • Thanks for response, I have the request working fine, the problem was a missing resource corresponding to "OPTIONS" web method. I resolved this by uritemplate "*" on a dummy operation. However the ajax call fails for a reason I do not know. Json object returned seemsto be valid as this works fine in ie but fails in chrome and firefox. – Mazolo Oct 19 '15 at 07:18
  • I have got the same problem, can you post an answer once you get it fixed :) – Murhaf Sousli Apr 10 '16 at 19:44

0 Answers0