Using HTTP from Visual Basic

As with the FTP protocol, we can use either the Execute() method or the OpenURL() method with the HTTP protocol. Using the Execute() method, we can use the HTTP GET, HEAD (get header), POST, and PUT commands. These commands appear in Table 3.3. You can also use the secure Web protocol, HTTPS, with the Internet Transfer control; just use that prefix instead of http in the URL of the document you want to establish a secure link to: "https://www.microsoft.com." In this way, you can open a secure Web session (if the user's Web browser supports secure sessions).

Table 3.3 HTTP Commands of the Internet Transfer Control's Execute Method

Command Does This
GET Gets the file named in URL (e.g., Execute "http://www.server.com/index.htm", "GET").
HEAD Gets headers of file given in URL property (e.g., Execute , "HEAD").
POST Provides additional data to support request to host (e.g., Execute , "POST", strFormData).
PUT Replaces data at URL (e.g., Execute , "PUT", "new.htm").

© 1997 by Steven Holzner. All rights reserved.