Hypertext Transfer Protocol

The SocketTools Hypertext Transfer Protocol (HTTP) control enables an application to easily access documents and other types of files on a server. In some ways it is similar to the File Transfer Protocol in that it can be used to upload and download files; however, the protocol has expanded to also support remote file management, script execution and distributed authoring over the World Wide Web. To download a free evaluation copy of SocketTools or for more information about this component, please select one of the following links:

ActiveX Control Overview

The Hypertext Transfer Protocol is a lightweight, stateless application protocol that is used to access resources on web servers, as well as send data to those servers for processing. The SocketTools control provides direct, low-level access to the server and the commands that are used to retrieve resources (i.e.: documents, images, etc.). The control also provides a simple interface for downloading resources to the local host, similar to how the FTP component can be used to download files. The Secure Edition control also supports encryption using the standard Secure Sockets Layer (SSL) and Transport Layer Security (TLS) protocols. With support for client side certificates and 128-bit encryption, the SocketTools HTTPS control is designed for commercial applications that require the highest degree of security and reliability.

In a typical session, the control is used to establish a connection, send a request (to download a resource, post data for processing, etc.), read the data returned by the server and then disconnect. It is the responsibility of the client to process the data returned by the server, depending on the type of resource that was requested. For example, if an HTML document was requested, the application may parse the contents of the file, looking for specific information, such as hyperlinks or email addresses. This control also supports secure connections using the standard SSL and TLS protocols. Note that a SocketTools Secure Visual Edition license must be purchased to use the security features in this component.

Control Features

The following are just some of the features in the SocketTools Hypertext Transfer Protocol control:

  • Standard ATL based ActiveX control compatible with most languages
  • Low resource utilization and no external dependencies on third-party libraries
  • Fully compatible with Visual Studio .NET languages
  • Includes both high level and lower level interfaces for maximum flexibility
  • Support for both synchronous and asynchronous network connections
  • Thread-safe implementation with full support for multithreaded applications
  • Support for proxy servers, including automatic proxy detection
  • An extensive Developer's Guide and online Technical Reference
  • A professional technical support staff and extensive online support resources
  • No runtime licensing fees or additional royalties
  • A trusted company with over 10 years experience developing Internet components

Code Example

The following code example in Visual Basic demonstrates how the control can be used to download a file from a file server and return the results in a file on the local system:

' Specify the URL to the resource that we wish to retrieve
' and the name of the local file it will be downloaded to
strRemoteFile = "http://www.server.com/files/filename.zip"
strLocalFile = "c:\temp\filename.zip"
  
' Download the file to the local system
nError = HttpClient1.GetFile(strRemoteFile, strLocalFile)
If nError > 0 Then
    MsgBox HttpClient1.LastErrorString, vbExclamation
    Exit Sub
End If

In this example, the GetFile method is used to download the file and store it on the local system. By providing the method with a complete URL, it automatically establishes the connection, retrieves the file and then disconnects from the server when the transfer has completed. If your application needs to download several files from the same server, then the control also supports persistent connections by using the Connect method.

As you can see, most of the code is actually related to error checking and comments, with only one line of code required to retrieve the file from the server. If you wanted to store the contents of the remote file in memory instead of creating a file on the local system, then you would use the GetData method instead, but all of the other code would remain the same.

SocketTools Links

Product Overview
An overview of the product features and benefits.


SocketTools Controls
The ActiveX controls that are included with this edition.


Frequently Asked Questions
Answers to the most common questions about SocketTools.


Download Product
Download a free evaluation copy of SocketTools.


Purchase Online
Purchase a developers license for this product.


Technical Reference
Review the online technical reference documentation.


Release Notes
Release notes for the current version of SocketTools.


License Agreement
The developer license agreement for this product.