title: ASP .NET Web API reading inputstream twice
body: <p>I am using ASP .NET Web API and I have a Controller that have code similar to this:</p>
  
  <pre><code>[Route("UpdateData")]
  [HttpPost]
  public HttpResponseMessage UpdateData([FromBody]RequestClasses.UpdataData data)
  {
      string json;
      if (HttpContext.Current.Request.InputStream.Length &gt; 0)
      {
          HttpContext.Current.Request.InputStream.Position = 0;
          using (var inputStream = new StreamReader(HttpContext.Current.Request.InputStream))
          {
              json = inputStream.ReadToEnd();
          }
      }
  
      // Dencrypt json
  
  return Request.CreateResponse(HttpStatusCode.OK);
  }
  </code></pre>
  
  <p>As input parameter I have "[FromBody]RequestClasses.UpdataData data". I have this in order to be able to show a Help page (using Microsoft.AspNet.WebApi.HelpPage).</p>
  
  <p>The data object received in this method is encrypted and I need to decrypt it.</p>
  
  <p>My problem is that I cannot call HttpContext.Current.Request.InputStream because the "[FromBody]RequestClasses.UpdataData data" has disposed my InputStream.</p>
  
  <p>Any good ideas to solve this? As I still need the help page to show which parameters to call the method with.</p>