title: HttpClient: The uri string is too long
body: <p>Given the following attempt to post data to a web service that generates PDF files, <strong><a href="https://www.html2pdfrocket.com/" rel="noreferrer">PDF rocket</a></strong> (<em>which is awesome by the way</em>).</p>
  
  <p>I get the error <strong>Invalid URI: The uri string is too long</strong><br>
  <em>Why would anyone impose an arbitrary limit on <code>POST</code>ed data?</em></p>
  
  <pre><code>using (var client = new HttpClient())
  {
      // Build the conversion options
      var options = new Dictionary&lt;string, string&gt;
      {
          { "value", html },
          { "apikey", ConfigurationManager.AppSettings["pdf:key"] },
          { "MarginLeft", "10" },
          { "MarginRight", "10" }
      };
  
      // THIS LINE RAISES THE EXCEPTION
      var content = new FormUrlEncodedContent(options);
  
      var response = await client.PostAsync("https://api.html2pdfrocket.com/pdf", content);
      var result = await response.Content.ReadAsByteArrayAsync();
      return result;
  }
  </code></pre>
  
  <p>I receive this rediculous error.</p>
  
  <pre><code> {System.UriFormatException: Invalid URI: The Uri string is too long.
     at System.UriHelper.EscapeString
     at System.Uri.EscapeDataString
     at System.Net.Http.FormUrlEncodedContent.Encode
     at System.Net.Http.FormUrlEncodedContent.GetContentByteArray
  </code></pre>
  
  <p>This reminds me of <code>640k</code> ought to be enough... I mean <em>really?</em></p>