I have a WINDOWS FORM C # application, where I communicate with a web service, when I try to send a very large data from my application to the web service I get error 500.
I can do a POST on any other object in JSON, but when it is this one that contains very large data it gives dick, the interesting fact is that if I try to give a get I can retrieve this data for my application, just do not I can send it to the server.
The large data is, a photo converted to base64 and a binary file that is also converted to base64.
Then follow the code that makes the post
public void POST(string url, string jsonContent)
{
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
request.Method = "POST";
System.Text.UTF8Encoding encoding = new System.Text.UTF8Encoding();
Byte[] byteArray = encoding.GetBytes(jsonContent);
request.ContentLength = byteArray.Length;
request.ContentType = @"application/json";
using (Stream dataStream = request.GetRequestStream())
{
dataStream.Write(byteArray, 0, byteArray.Length);
}
long length = 0;
try
{
using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
{
length = response.ContentLength;
}
}
catch (WebException ex)
{
// Log exception and throw as for GET example above
}
}
This method works cool with smaller jsons.
Who does have a notion of how I can solve this problem?