Hi,
I am not able to convert the response stream from HttpWebResponse into bytes
properly.
Here is the relevent code -
HttpWebResponse response = (HttpWebResponse)request.GetResponse ();
// Get the stream associated with the response.
Stream receiveStream = response.GetResponseStream ();
// Pipes the stream to a higher level stream reader with the required
// encoding format.
StreamReader readStream = new StreamReader (receiveStream, Encoding.ASCII);
string receivestream = readStream.ReadToEnd ();
// rgBuffer is a big enough byte array.
rgBuffer = Encoding.ASCII.GetBytes (receivestream) ;
response.Close ();
readStream.Close ();
I see a problem in the way I am converting my response to bytes. rgBuffer
doesn't carry correct values.
What is the correct way?
Thanks,
SK