Link to home
Start Free TrialLog in
Avatar of Nikhil Gupta
Nikhil Gupta

asked on

HttpWebresponse

How to write a Stream received from an httpWebResponse into a byte array in C#?
Thanks in advance..
Avatar of Thandava Vallepalli
Thandava Vallepalli
Flag of United States of America image

HttpWebResponse response = (HttpWebResponse)request.GetResponse();

// we will read data via the response stream
Stream resStream = response.GetResponseStream();
            
    int Length = 256;
    Byte [] buffer = new Byte[Length];
    int bytesRead = readStream.Read(buffer,0,Length);


itsvtk

ASKER CERTIFIED SOLUTION
Avatar of Thandava Vallepalli
Thandava Vallepalli
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial