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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • robertybob
    New Member
    • Feb 2013
    • 116

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

    Hi,

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

    Code:
    Dim myURL As HttpWebRequest
    myURL = WebRequest.Create("https://www.abc.efg/data")
    myURL.Method = "POST"
    myURL.ContentType = "application/json"
    etc...
    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.Crea te 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!
Working...