SocketTools .NET Edition

HttpClient Class

Implements the Hypertext Transfer Protocol.

For a list of all members of this type, see HttpClient Members.

System.Object
   SocketTools.HttpClient

[Visual Basic]
Public Class HttpClient
    Implements IDisposable
[C#]
public class HttpClient : IDisposable

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Example

The Hypertext Transfer Protocol (HTTP) 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 HttpClient class provides direct, low-level access to the server and the commands that are used to retrieve resources (i.e.: documents, images, etc.). The class also provides a simple interface for downloading resources to the local host, similar to how the HttpClient class can be used to download files.

In a typical session, the class 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 client may parse the contents of the file, looking for specific information.

This class supports secure connections using the standard SSL and TLS protocols.

Requirements

Namespace: SocketTools

Assembly: SocketTools.HttpClient (in SocketTools.HttpClient.dll)

See Also

HttpClient Members | SocketTools Namespace