I have an ASP.NET WEB API code running on .NET 4.5 with MVC 4.0 RC and EF 5.0 Pre-release. This is running on IIS 7.5, Win server 2008 R2 Datacenter.
The phenomena is this:
when calling POST locally to localhost (on IIS), all is ok and I get redirected to the created object as the response page (it's set in the response header) with status 201.
But when calling from external URL, I get no response. The code runs well and there is no exception, but in chrome developer tools for example, I see no response coming back. it says the request was cancelled.
No matter what I tried, can't solve this. THE EXACT SAME CODE on the same IIS folder runs from local calls fine, but for remote calls - returns nothing. This happens for 2 different controllers.
However, other calls (Get for example) work well for both local and remote calls.
This is the Controller code in the POST method which builds the response:
HttpResponseMessage response = this.Request.CreateResponse<Movie>(HttpStatusCode.Created, Movie);
string uri = Url.Route(null, new { id = Movie.Id });
response.Headers.Location = new Uri(Request.RequestUri, uri);
return response;
Your help muchly appreciated!
Thanks!