Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an IIS7.5 box running an mvc 3 application. The application receives binary POST requests and returns a binary answer. To distinguish this binary data from all other packets I setup my own mime-type (let's call it application/ that I use together with the Content-Type header.

The IIS-server does not seem to like my own mime-type and rejects the packet with a 400 Bad Request. If I change the mime-type to application/octet-stream it gets through IIS and I get an answer from my application.

How do I set IIS to allow my own mime-type for requests?

Request packet

POST http://my.local.domain/Page  HTTP/1.1
Host: my.local.domain
Content-Length: 33
Content-Type: application/
Cache-Control: no-cache


Response packet:

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: Wed, 06 Jul 2011 08:11:27 GMT
Content-Length: 11

Bad Request
share|improve this question
up vote 1 down vote accepted

I was finally able to fix the problem by following the following guide at

I added the following code to my web.config

  <httpErrors errorMode=”Detailed” />
share|improve this answer

Something like this blog here: may shed light on what you need to do.

Mainly its update the static content settings in your applications web.config so that IIS7.5 knows about your own mime type.

share|improve this answer
Isn't this only for serving static content? I want to POST binary content into my application. – m__ Jul 6 '11 at 9:32
I've tried it but it doesn't seem to work either. – m__ Jul 6 '11 at 9:37
Tired brain, I miss read your question the first time. Why do you need to differenciate your mime type coming in? – ITHedgeHog Jul 6 '11 at 9:42
I'm using it to distinguish which packets are valid and which aren't in my code. – m__ Jul 6 '11 at 9:44
I'm not understanding the why you would need to do that, surely if the binary data doesn't match what is expected your site should just return an error to the user? Or are you handling multiple mime types here? – ITHedgeHog Jul 6 '11 at 9:57

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.