I\'ve done a bit of searching, and most people seem to hit this when sending larger amounts of data, but I\'m not.
I\'m making a request to an API with the followin
For me it was going wrong with a special character (é) in a Json request. For some reason I had to set the ContentLength manually.
Thanks to the tip on this page I changed my code to the following and for me it works now.
Old version:
string content = "{ test: \"olé\" }";
_Request.ContentLength = content.Length;
using ( var writer = new StreamWriter(_Request.GetRequestStream()) )
writer.Write( content );
New version:
string content = "{ test: \"olé\" }";
byte[] bytes = Encoding.UTF8.GetBytes(content);
_Request.ContentLength = bytes.Length;
using ( var writer = _Request.GetRequestStream() )
writer.Write(bytes, 0, bytes.Length);