By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,919 Members | 1,625 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,919 IT Pros & Developers. It's quick & easy.

HttpWebRequest - can I store the endpoint URL for faster access?

100+
P: 116
Hi,

I am using the following method to access a server-based file.

Expand|Select|Wrap|Line Numbers
  1. Dim myURL As HttpWebRequest
  2. myURL = WebRequest.Create("https://www.abc.efg/data")
  3. myURL.Method = "POST"
  4. myURL.ContentType = "application/json"
  5. etc...
  6.  
I'm wondering if it is possible to store the HttpWebRequest on load and use it for all future requirements? I get the feeling that the WebRequest.Create needs to locate the file each time (?) which slows things up unnecessarily.

If this is possible, do I need to alter the code in some way? Such as Dim myURL As NEW HttpWebRequest = storedURL?

Thanks!
Jan 15 '15 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.