title: Web Api Request Throws "Error while copying content to a stream."
body: <p>I'm trying to implement this <a href="http://bizcoder.com/posting-raw-json-to-web-api" rel="noreferrer">code example</a>, but get a <code>HttpRequestException</code> - "<em>Error while copying content to a stream</em>." when the <code>ReadAsStringAsync()</code> method is called.  The inner exception is "<em>Cannot access a disposed object</em>."  I'm using Fiddler to make the request.  I don't understand. Can someone explain why I'm getting this exception and offer a solution?</p>
  
  <p>Web Api Method:</p>
  
  <pre><code>public async Task&lt;HttpResponseMessage&gt; Post(HttpRequestMessage request)
  {
      try
      {
          var jsonString = await request.Content.ReadAsStringAsync();
      }
      catch (Exception ex)
      {                
          throw;
      }
      return new HttpResponseMessage(HttpStatusCode.Created);
  }
  </code></pre>
  
  <p>Fiddler (POST):</p>
  
  <pre><code>User-Agent: Fiddler
  Host: localhost:23567
  Content-Length: 18
  Content-Type: application/json; charset=utf-8
  Body{"Test":1}
  </code></pre>
  
  <p>Edit:</p>
  
  <p>I have a clue, but need verification.  On the Web Api controller, I have an <code>ActionFilterAttribute</code> and in its <code>OnActionExecuting</code> override, there's this line:</p>
  
  <pre><code>public override async void OnActionExecuting(HttpActionContext actionContext)
  {
      // omitted code
      actionContext.Request.Content.ReadAsStreamAsync();
  }
  </code></pre>
  
  <p>Could it be that because the Content is read here, it's not available again?  If so, how can I make it available in the method?  Is the Content here the same as the HttpRequestMessage?  <a href="https://stackoverflow.com/questions/13021089/why-is-the-body-of-a-web-api-request-read-once">This</a> may contain an answer.</p>