title: 400 Bad Request HTTP Response using a WCF POST via JQuery
body: <p>Having trouble getting my JQuery POST to be accepted by the WCF Service.  Here's the POST from the javascript:</p>
  
  <pre><code>function jqueryPost() {
      var url = "/LoggingTest";
      $.post(url, { message: "test message" });
  }
  </code></pre>
  
  <p>This is how I'm accepting the POST, via an Interface:</p>
  
  <pre><code>[OperationContract]
  [WebInvoke(Method = "POST",
             UriTemplate = "/LoggingTest",
             BodyStyle = WebMessageBodyStyle.Bare)]
  void LoggingTest(string message);
  </code></pre>
  
  <p>And the implementation:</p>
  
  <pre><code>public void LoggingTest(string message)
  {
      log.Debug(message, null);
  }
  </code></pre>
  
  <p>When I call the function jqueryPost I see in the web inspector an HTTP response of <strong>400 Bad Request</strong>.  Not sure how to get the POST request to work.</p>
  
  <p>(Added on 7/1) <br>
  @James, here is the output from the web inspector:</p>
  
  <blockquote>
    <p><a href="http://localhost:4252/LoggingTest" rel="noreferrer">http://localhost:4252/LoggingTest</a>
    HTTP Information <br>
    Request Method:POST<br>
    Status Code:400 Bad Request <br>
    Request Headers <br>
    Accept:<em>/</em> <br>
    Cache-Control:max-age=0 <br>
    Content-Type:application/x-www-form-urlencoded <br>
    Origin:<a href="http://localhost:4252" rel="noreferrer">http://localhost:4252</a> <br>
    Referer:<a href="http://localhost:4252/" rel="noreferrer">http://localhost:4252/</a> <br>
    User-Agent:Mozilla/5.0 (Windows; U; Windows NT 5.1; C -) AppleWebKit/532.4 (KHTML, like Gecko) Qt/4.6.2 Safari/532.4 <br>
    X-Requested-With:XMLHttpRequest <br>
    Form Data <br>
    message:test message <br>
    Response Headers <br>
    Content-Length:1165 <br>
    Content-Type:text/html <br>
    Date:Thu, 01 Jul 2010 18:56:15 GMT <br>
    Server:Microsoft-HTTPAPI/1.0 <br></p>
  </blockquote>