title: ASP.NET WebAPI JSON Binding Case-Sensitivity
body: <p>Upgrading from ASP.NET WebAPI Beta to RC has provided some amount of excitement and a great deal of frustration.  I have been able to work through the majority of the issues, but the one that is biting me right now is case-sensitivity of JSON request data.</p>
  
  <p>The formatter used for JSON requests (which by default is a JSON.NET formatter) appears to be case sensitive while the formatter used for form-urlencoded data does not.  Is there a way to configure the JSON requests to use a case-insensitive formatter?</p>
  
  <p>Here is a simple example to illustrate the problem that I am having with JSON requests:</p>
  
  <p><strong>HTML / JavaScript</strong></p>
  
  <pre><code>&lt;button id="tester"&gt;Click here!&lt;/button&gt;
  
  &lt;script type="text/javascript"&gt;
      $(function () {
          $("#tester").on("click", function() {
              $.ajax({
                  type: "POST",
                  url: "/Api/Test/Index/" + 168,
                  data: ko.toJSON({ key: 123, value: "test value" }), // THIS FAILS
                                 // Key: 123, Value: "test value" &lt;- BUT THIS WORKS
                  contentType: "application/json; charset=utf-8",
                  statusCode: {
                      200: function () {
                          $("body").append("&lt;p&gt;Success&lt;/p&gt;");
                      },
                      400: function () {
                          $("body").append("&lt;p&gt;Failure&lt;/p&gt;");
                      }
                  }
              }).always(function () {
                  $("body").append("&lt;hr /&gt;");
              });
          });
      });
  &lt;/script&gt;
  </code></pre>
  
  <p><strong>C#</strong></p>
  
  <pre><code>public class TestController : ApiController
  {
      public HttpResponseMessage Index(int? id, KeyValuePair&lt;int, string&gt; test)
      {
          if (id != 168 || test.Key != 123 || test.Value != "test value")
              return Request.CreateResponse(HttpStatusCode.BadRequest);
  
          return Request.CreateResponse(HttpStatusCode.OK);
      }
  }
  </code></pre>
  
  <p>I've provided a comment on the line where the JSON data is provided.  I would rather not break convention with my JavaScript objects by proper casing property members and I certainly do not want to break convention by lower casing my C# properties.  Any thoughts?</p>