Question

I have a VS 2012 solution with a web api server project and a javascript-html client project. I can test my web api with Fiddler. I can test from another test project using HttpClient, but because I have the server and the client running on separate ports in IIS Express, I have some kind of CORS issue because when I try to make an ajax call from the client I get a 405 method not allowed error.

I have added the suggested custom header entries to my web.config and applicationhost.config files that should allow cross origin access.

There must be some simple solution to this that everyone uses, but it seems to escape me.

Was it helpful?

Solution

I found the answer here. I had to add the nuget package for system.web.http.cors and the web api took care of everything. Didn't need to touch my client side javascript.

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