title: InvalidDataException: Line length limit 100 exceeded when uploading with RestSharp to .Net Core 2.1
body: <p>When uploading data files with RestSharp to a .Net Core 2.1 REST interface, I get this error on some files:</p>
  
  <pre><code>System.IO.InvalidDataException: Line length limit 100 exceeded.
  at Microsoft.AspNetCore.WebUtilities.BufferedReadStream.ReadLineAsync(Int32 lengthLimit, CancellationToken cancellationToken)
  at Microsoft.AspNetCore.WebUtilities.MultipartReaderStream.ReadAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken)
  at Microsoft.AspNetCore.WebUtilities.StreamHelperExtensions.DrainAsync(Stream stream, ArrayPool`1 bytePool, Nullable`1 limit, CancellationToken cancellationToken)
  at Microsoft.AspNetCore.WebUtilities.MultipartReader.ReadNextSectionAsync(CancellationToken cancellationToken)
  </code></pre>
  
  <p>When I do the same operation with Insomnia, I do not get any error, only with RestSharp.</p>
  
  <p>I have read here <a href="https://stackoverflow.com/questions/44642701/microsoft-aspnetcore-webutilities-line-length-limit-100-exceeded">Microsoft.AspNetCore.WebUtilities Line length limit 100 exceeded</a> that there is a problem with the line ending formats, but this is the only article about it, and it doesn't provide any real solution.</p>
  
  <p>The controller signature is very simple:</p>
  
  <pre><code>[HttpPost, DisableRequestSizeLimit]
  public async Task&lt;IActionResult&gt; AddPictureAsync(
      IFormFile Picture,
      IFormFile Thumbnail,
      string Title)
  {
  </code></pre>
  
  <p>and the code to send is:</p>
  
  <pre><code>var Request = new RestRequest("picture", Method.POST) { AlwaysMultipartFormData = true };
  Request.AddHeader("SessionId", SessionId);
  Request.AddFile("Picture", PhotoData.ToArray(), Photo.PhotoUrl);
  Request.AddFile("Thumbnail", ThumbnailData, Photo.PhotoUrl.Replace(".jpg", "-t.jpg"));
  Request.AddParameter("Title", Photo.Title ?? string.Empty, ParameterType.GetOrPost);
  </code></pre>
  
  <p>Where should I look at?</p>