Click here to Skip to main content
15,888,968 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello ,
I am using this code.
C#
WebRequest webRequest = WebRequest.Create(strURL);
webRequest.Method = "POST";
webRequest.ContentType = "application/x-www-form-urlencoded";
string parameters = "xml=" + s;
byte[] bytes = Encoding.UTF8.GetBytes(parameters);
webRequest.ContentLength = bytes.Length;
Stream dataStream = webRequest.GetRequestStream();
dataStream.Write(bytes, 0, bytes.Length);
dataStream.Close();
WebResponse webResponse = webRequest.GetResponse();
dataStream = webResponse.GetResponseStream();
StreamReader reader = new StreamReader(dataStream);
responseFields = reader.ReadToEnd();
reader.Close();
dataStream.Close();
webResponse.Close();


Here bytes length is 3050 and
It showing an exception that "this stream does not support seek operations" in
Stream dataStream = webRequest.GetRequestStream(); in this line


Thanks & Regards
Srishti
Posted
Updated 7-Jan-14 2:21am
v2

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900