Here is my code
string parameters = @"OrderId,OrderedDate,OrderType,ProductId,SubscriptionPeriod,SubscriptionPrice,SubscriptionVolumeCount,SubscriptionScheduleId,UserId" +
Environment.NewLine + "1,2013-08-07 19:41:28,1,1300002727,1,800,1,961193,1";
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);
request.ContentType = "application/x-www-form-urlencoded";
request.Method = "POST";
request.KeepAlive = false;
byte[] bytes = Encoding.ASCII.GetBytes(parameters);
request.ContentLength = bytes.Length;
using (Stream os = request.GetRequestStream())
{
os.Write(bytes, 0, bytes.Length);
os.Close();
using (WebResponse response = request.GetResponse())
{
if (response == null)
{
Console.WriteLine("Response is null");
}
using (StreamReader reader = new StreamReader(response.GetResponseStream()))
{
string s=reader.ReadToEnd().Trim();
ErrorLog.WriteLog("FujiApiPost", "FujiApiPostfn", "result:" + s, string.Empty, string.Empty);
}
}
}
Error:-Length = 'os.Length' threw an exception of type 'System.NotSupportedException'