Note that there are some explanatory texts on larger screens.

plurals
  1. POError when sending large data with HTTP Post
    primarykey
    data
    text
    <p>I am using the following code to send data to an web API from a WinForms app:</p> <pre><code>private string SendBatch(string URL, string POSTdata) { string responseData = ""; try { HttpWebRequest hwrequest = (HttpWebRequest)WebRequest.Create(URL); hwrequest.Timeout = 600000; hwrequest.KeepAlive = true; hwrequest.Method = "POST"; hwrequest.ContentType = "application/x-www-form-urlencoded"; byte[] postByteArray = System.Text.Encoding.UTF8.GetBytes("data=" + POSTdata); hwrequest.ContentLength = postByteArray.Length; System.IO.Stream postStream = hwrequest.GetRequestStream(); postStream.Write(postByteArray, 0, postByteArray.Length); postStream.Close(); HttpWebResponse hwresponse = (HttpWebResponse)hwrequest.GetResponse(); if (hwresponse.StatusCode == System.Net.HttpStatusCode.OK) { System.IO.StreamReader responseStream = new System.IO.StreamReader(hwresponse.GetResponseStream()); responseData = responseStream.ReadToEnd(); } hwresponse.Close(); } catch (Exception e) { responseData = "An error occurred: " + e.Message; } return responseData; } } </code></pre> <p>When I send a small amount of data, the API receives the data without any issues. However, when I try to send a large amount of data (30MB+) I get an error from the API that I have sent through malformed data.</p> <p>I have set the timeout to 10 minutes and I receive the error after around 2 minutes.</p> <p>According to the questions I have gone through on SO, there isn't a limit to the post size and there is no limit on the API.</p> <p>I've been trying for a few days to find a solution so any pointers will be GREATLY appreciated.</p> <p>Thanks!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload