title: Why doing POST throws an exception in MVC 4?
body: <p>I am trying to do a POST like this:</p>
  
  <pre><code>    HttpClient hc = new HttpClient();
      byte[] bytes = ReadFile(@"my_path");
  
      var postData = new List&lt;KeyValuePair&lt;string, string&gt;&gt;();
      postData.Add(new KeyValuePair&lt;string, string&gt;("FileName", "001.jpeg"));
      postData.Add(new KeyValuePair&lt;string, string&gt;("ConvertToExtension", ".pdf"));
      postData.Add(new KeyValuePair&lt;string, string&gt;("Content", Convert.ToBase64String(bytes)));
  
      HttpContent content = new FormUrlEncodedContent(postData);
      hc.PostAsync("url", content).ContinueWith((postTask) =&gt; {
      postTask.Result.EnsureSuccessStatusCode();
      });
  </code></pre>
  
  <p>but I receive this exception:</p>
  
  <blockquote>
    <p>Invalid URI: The Uri string is too long.</p>
  </blockquote>
  
  <p>complaining about this line: <code>HttpContent content = new FormUrlEncodedContent(postData);</code>. For small files it works but I don't understand why for larger ones it doesn't? </p>
  
  <p>When I do POST the <strong>content</strong> can be larger...Then why it complains about URI?</p>