title: Can't set Content-Type header on HttpResponseMessage headers?
body: <p>I'm using the ASP.NET WebApi.  I'm creating a PUT method within one of my controllers, and the code looks like this:</p>
  <pre class="lang-cs prettyprint-override"><code>public HttpResponseMessage Put(int idAssessment, int idCaseStudy, string value) 
  {
      var response = Request.CreateResponse();
      
      if (!response.Headers.Contains(&quot;Content-Type&quot;)) 
          response.Headers.Add(&quot;Content-Type&quot;, &quot;text/plain&quot;);
  
      response.StatusCode = HttpStatusCode.OK;
      
      return response;
  }
  </code></pre>
  <p>When I PUT to that location with the browser via AJAX, it gives me this Exception:</p>
  <blockquote>
  <p>Misused header name. Make sure request headers are used with
  HttpRequestMessage, response headers with HttpResponseMessage, and
  content headers with HttpContent objects.</p>
  </blockquote>
  <p>But isn't <code>Content-Type</code> a perfectly valid header for a response?  Why am I getting this exception?</p>