title: How to read a WebClient response after posting data? WebClient.UploadData Method (String, String, Byte[])
body: <p>My Code here.</p>
  
  <pre><code>string uriString = "http://www.Testcom";
  WebClient myWebClient = new WebClient();
  string postData = "data";
  myWebClient.Headers.Add("Content-Type","application/x-www-form-urlencoded");
  Console.WriteLine(myWebClient.Headers.ToString());
  byte[] byteArray = Encoding.ASCII.GetBytes(postData);        
  byte[] responseArray = myWebClient.UploadData(new 
  Uri(uriString),"POST",byteArray);
  </code></pre>
  
  <p>Now I call UploadData and get method created in my API project something like this.</p>
  
  <pre><code>[HttpPost]
  [Route("doc2pdf")]
  public HttpResponseMessage doc2pdf(byte[] fileContent)
  {
      string pdfContent = string.Empty;
      //if(string.IsNullOrEmpty(docContent))
      //{
      //    var resp = Request.CreateResponse(HttpStatusCode.BadRequest,"Document content is empty.");
      //    return resp;
      //}
      if(fileContent != null || fileContent.Length &gt; 0)
      {
          ..logic here
      }
  }
  </code></pre>
  
  <p>The problem is always fileContent get {byte[0]}.
  <img src="https://i.stack.imgur.com/F3WyZ.png" alt="enter image description here"></p>
  
  <p>Now, how do I read the HTTP output?</p>