title: Read byte array from HttpRequest body
body: <p>I am trying to retrieve byte array from HttpRequest post body. The post body contains object with two properties. 1. "Id" is of type <code>string</code> and 2. "Data" is of type <code>byte[]</code>. </p>
  
  <p>The Data property contains file data converted into byte array using code :</p>
  
  <pre><code>Data = File.ReadAllBytes("fileName");
  
  var responseObj = JObject.Parse(await new StreamReader(request.Body).ReadToEndAsync());
  
  string id = responseObj["Id"].Value&lt;string&gt;();
  var data= responseObj["Data"].Value&lt;byte[]&gt;();
  </code></pre>
  
  <p>The last line of code is giving me exception.  I am trying to store byte array into a file and then retrieve at later stage.</p>