Issuing HTTP Commands
There are very few commands for HTTP transfers when compared to the list of commands for FTP. However, HTTP was designed to be a lightweight tool that would let people easily download documents from the server, so fewer commands are necessary. Table 11.6 lists the HTTP commands for the Internet Transfer control
Table 11.6: HTTP Commands for the Internet Transfer Control
HTTP Command | Description |
GET | Retrieves the document specified in the URL property (use GetHeader to retrieve header information and GetChunk to get the rest of the information) |
HEAD | Gets the header information (use GetHeader to retrieve header information) |
POST | Sends data to the server |
PUT | Replaces the page specified in the URL property with the specified data |
Of the four commands available in the Internet Transfer control for HTTP transfers, the GET command will be the most used. This command is used to retrieve a document based on the supplied URL. The HEAD command is used to retrieve only the document’s header information. Both commands need to use the GetHeader method to retrieve header information, and the GET command uses the GetChunk method to retrieve the body of the document.
The POST command is used to send data back to the server. This is most often used with HTML forms that need to transmit data to the server for processing. The PUT method is used to add a new document or file to the web server or update an existing document. This command may not work with all web servers, and it will most likely require information in the headers for authorization information.