Sign in Join
FPDoc Onlineexperiment

fpHTTPClient unit

HTTP client implementation for making HTTP requests

The fpHttpClient unit provides a complete HTTP client implementation for making HTTP requests. It supports all standard HTTP methods (GET, POST, PUT, DELETE, PATCH, OPTIONS, HEAD), SSL/TLS connections, redirects, authentication, cookies, and form posting including file uploads.

The main classes are TFPCustomHTTPClient (base class) and TFPHTTPClient (with published properties). The unit also supports Server-Sent Events through TCustomHTTPEventSource and proxy connections through TProxyData.

Classes and records

EHTTPClientclassException class for HTTP client errors
EHTTPClientSocketclassException class for HTTP client socket errors
EHTTPClientSocketReadclassException class for HTTP client socket read errors
EHTTPClientSocketWriteclassException class for HTTP client socket write errors
TCustomHTTPEventSourceclassBase class for Server-Sent Events (SSE) client
TFPCustomHTTPClientclassBase HTTP client class for making HTTP requests
TFPHTTPClientclassFull-featured HTTP client with published properties
THTTPEventSourceclassDefault Server-Sent Events source implementation
TProxyDataclassProxy server configuration data

Procedures and functions

DecodeURLElementfunctionURL-decodes a string from URL encoding
EncodeURLElementfunctionURL-encodes a string for use in URLs

Types

TDataEventprocedure typeEvent type for tracking data transfer progress
TGetSocketHandlerEventprocedure typeEvent type for providing custom socket handlers
THTTPEventStreamHandlerprocedure typeEvent type for handling Server-Sent Events streams
THTTPVerifyCertificateEventprocedure typeEvent type for SSL certificate verification
TPasswordEventprocedure typeEvent type for handling authentication challenges
TRedirectEventprocedure typeEvent type for handling HTTP redirects
TSocketHandlerCreatedEventprocedure typeEvent type called after socket handler creation

Constants

DefaultMaxHeaderCountconstant
DefaultMaxHeaderLineLengthconstant
DefaultMaxResponseSizeconstant
DefMaxRedirectsconstantDefault maximum number of HTTP redirects to follow
ReadBufLenconstantDefault buffer size for socket reading operations

Topics

fpHttpClientAdvancedtopicAdvanced TFPHTTPClient Features
fpHttpClientFileUploadtopicFile Upload with Local Filename
fpHttpClientFormPosttopicForm Data and File Upload with fpHttpClient
fpHttpClientHttpstopicHTTPS Support in TFPHTTPClient
fpHttpClientMethodstopicHTTP Methods with TFPHTTPClient
fpHttpClientUsagetopicUsing the TFPHTTPClient

Uses

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.