title: Web Api Request Content is empty in action filter
body: <p>I have an attribute named <code>Log</code> that tries to log the content of request and response into a text file. I've put that over my Controller to cover all the actions. In <code>LogAttribute</code> I'm reading content as a string (<code>ReadAsStringAsync</code>) so I don't lose request body. </p>
  
  <pre><code>public class LogAttribute : ActionFilterAttribute
  {
      // ..
      public override void OnActionExecuting(HttpActionContext actionContext)
      {
          // stuff goes here
          var content = actionContext.Request.Content.ReadAsStringAsync().Result; 
          // content is always empty because request body is cleared
      }
  
      public override void OnActionExecuted(HttpActionExecutedContext actionExecutedContext)
      {
          // other stuff goes here
          var content = actionContext.Request.Content.ReadAsStringAsync().Result;
          // content is always empty because request body is cleared
      }
  
      // ..
  }
  </code></pre>
  
  <p>On the other hand, I've put the <code>FromBody</code> attribute before my action parameter class to take advantage of its benefits. </p>
  
  <pre><code>[Log]
  public class SomethingController
  {
      public HttpResponseMessage Foo([FromBody] myModel)
      {
          // something
      }
  }
  </code></pre>
  
  <p>The problem is the content is always empty either in <code>ActionExecuting</code> or <code>ActionExecuted</code>.</p>
  
  <p>I think this is because <code>FromBody</code> runs before my <code>Log</code> attribute unlike their order in the code. And again I think its because of finding the best action/controller match for the request according to action parameters (Route Processing). After that my request body is cleared since request body is non-buffered in WebApi. </p>
  
  <p>I want to know if there is any way to change the run time order of the <code>FromBody</code> attribute and my <code>Log</code> attribute? or something else that solves the problem! I should mention that I don't want to remove the <code>FromBody</code> and using <code>HttpRequestMessage</code> instead of my Model or something like that.</p>