title: stream was reset: PROTOCOL_ERROR
body: <p>I've written a web API for sending and receiving data between a server and an app I'm working on.</p>
  
  <p>It works fine for everything, but I've now found it won't let me send large strings. The strings are base64 strings which represent images, typically around 100kb in size.</p>
  
  <p>The method I'm attempting is a multipart post, breaking the base64 string into chunks that can be sent successfully.</p>
  
  <p>When I use this method, I get an error:</p>
  
  <blockquote>
    <p>stream was reset: PROTOCOL_ERROR</p>
  </blockquote>
  
  <p>Upon checking the database it seems the first string chunk sends successfully, but nothing more after that.</p>
  
  <p>Can anyone shed some light on what's causing this to happen?</p>
  
  <p>Relevant code is here:</p>
  
  <p>First is the process for breaking the image into manageable chunks and posting it:</p>
  
  <pre><code>HTTPRequest req = new HTTPRequest();
  
  IEnumerable&lt;string&gt; imgStrSplit = Split(img1byteArrayStr, 1000);
  
                      foreach (string s in imgStrSplit)
                      {
                          response = await req.SubmitImage("Test", s, "1");
                      }
  </code></pre>
  
  <p>And below is the SubmitImage() method of the HTTPRequest class:</p>
  
  <pre><code>public async Task&lt;int&gt; SubmitImage(string name, string imageString, string imgNum)
          {
  
              using (System.Net.Http.HttpClient client = new System.Net.Http.HttpClient(new NativeMessageHandler()))
              {
                  client.DefaultRequestHeaders.Add("Accept", "application/json");
  
                  int successResponse;
  
                  string address = $"https://myURL/SubmitImage?name=" + name + "&amp;imageStr=" + imageString + "&amp;imgNum=" + imgNum + "&amp;curl=AYZYBAYZE143";
  
                  HttpResponseMessage response = await client.GetAsync(address);
  
                  successResponse = JsonConvert.DeserializeObject&lt;int&gt;(response.Content.ReadAsStringAsync().Result);
  
                  return successResponse;
  
              }
  </code></pre>
  
  <p>Thanks.</p>