I want my ASP.NET MVC application return HTTP response with code 400 and description of the error as body. My code is:
response.StatusCode = 400;
response.Write("Some error");
response.End();
When I test this code on localhost, I get expected result. But on remote server, response text contains just text description of the error, in this case "Bad Request".
- Could you please explain this behavior?
- What is solution to this?
Web Server - IIS7, locahost means that I access from local computer, remote - from remote.