HttpWebRequest question

  • Thread starter Thread starter Tom Jones
  • Start date Start date
T

Tom Jones

Hi,

I am unsure as to what the proper usage model for HttpWebRequest is.

Do I create a new request instance each time I interact with a specific
server?

For example, if I need to perform a GET, then a POST, and then another GET,
do I use the same HttpWebRequest instance, or do I continually create new
instances and repopulate each one (e.g. cookies)?

Thanks,
tj
 
Hi tj:

You can create new instances for each request. Create a single CookieContainer
and assign it to the Cookies property of each instance to keep the cookies
in synch.

HTH,
 
Back
Top