I would like to create 2 HTTP requests on the same connection (HTTP persistent connection).
I'm using HttpWebRequest:
WebRequest request = HttpWebRequest.Create("http://localhost:14890/Service1/3");
WebResponse response = request.GetResponse();
byte[] buffer = new byte[1024];
int x = response.GetResponseStream().Read(buffer, 0, 1024);
string str = System.Text.ASCIIEncoding.ASCII.GetString(buffer);
I think if I use request
again it will create a whole new HTTP connection which I don't want to do.
Is there another class I can use isntead or is there something I'm missing?
I'm also not sure how the WebClient class works with respect to persistent connections.