Skip to content

Instantly share code, notes, and snippets.

View MarvinZ's full-sized avatar

MarvinZ

View GitHub Profile
@beccasaurus
beccasaurus / README.markdown
Created April 19, 2011 17:50
Without this, returning a 400 gives you just "Bad Request" ... with this, you can return a custom response

If you don't have the XML snippet below in your Web.config and your .NET app tries to return a 400 with custom data, you get this:

HTTP/1.1 400 Bad Request
Cache-Control: private
Content-Type: text/html
Server: Microsoft-IIS/7.5
X-AspNetMvc-Version: 3.0
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET

Date: Tue, 19 Apr 2011 17:47:46 GMT