title: Prevent IIS from changing response when Location header is present
body: <p>I have a RESTful web service written in a PHP-based framework running on IIS which responds to a POST request with something like</p>
  
  <pre><code>Status: 201 Created
  Location: [url of created object]
  Content-length: [correct]
  
  { my: "created object" }
  </code></pre>
  
  <p>It seems because of the Location header IIS is adding text to the response so it becomes (HTML removed for clarity):</p>
  
  <pre><code>Status: 201 Created
  Location: [url of created object]
  Content-length: [incorrect!]
  
  Document Moved
  Object Moved This document may be found here
  { my: "created object" }
  </code></pre>
  
  <p>I don't mind the addition of the text so much, but IIS seems to be keeping the original content-length while changing the content, creating an invalid response and thus causing the consumer of the web service to give me a protocol violation error.</p>
  
  <p>Is there a way to prevent IIS from mangling my response?</p>
  
  <p><strong>Edit:</strong> Never did find an answer - I ended up switching to Apache</p>