Since your .NET Web API and Client-Side projects are being hosted on different ports, it's considered a Cross-Domain (CORS) request. Just add the proper header in your web.config from your web API application: <configuration> < system . webServer > <httpProtocol> <customHeaders> < add name = "Access-Control-Allow-Origin" value = "*" /> < add name = "Access-Control-Allow-Headers" value = "Content-Type" /> < add name = "Access-Control-Allow-Methods" value = "GET, POST, PUT, DELETE, OPTIONS" /> </ customHeaders > </ httpProtocol > </ system . webServer > </ configuration >
Comments
Post a Comment