private static void AddPostData(WebRequest webRequest, string data)
{
webRequest.Method = "POST";
var bytes = Encoding.UTF8.GetBytes(data);
webRequest.ContentLength = bytes.Length;
webRequest.ContentType = "application/x-www-form-urlencoded";
using (var requestStream = webRequest.GetRequestStream())
{
requestStream.Write(bytes, 0, bytes.Length);
}
}