title: Access Request Body in a WCF RESTful Service
body: <p>How do I access the HTTP POST request body in a WCF REST service?</p>
  
  <p>Here is the service definition:</p>
  
  <pre><code>[ServiceContract]
  public interface ITestService
  {
      [OperationContract]
      [WebInvoke(Method = "POST", UriTemplate = "EntryPoint")]
      MyData GetData();
  }
  </code></pre>
  
  <p>Here is the implementation:</p>
  
  <pre><code>public MyData GetData()
  {
      return new MyData();
  }
  </code></pre>
  
  <p>I though of using the following code to access the HTTP request:</p>
  
  <pre><code>IncomingWebRequestContext context = WebOperationContext.Current.IncomingRequest;
  </code></pre>
  
  <p>But the IncomingWebRequestContext only gives access to the headers, not the body.</p>
  
  <p>Thanks.</p>