HTTPDefs unit
Basic HTTP protocol declarations and classes
The HTTPDefs unit provides essential types, constants, and classes for HTTP protocol handling.
It contains basic HTTP header field definitions, request and response classes, cookie management,
file upload support, and MIME content handling for web applications.
Classes and records
EHTTP | class | HTTP exception class |
TCookie | class | HTTP cookie implementation |
TCookies | class | Collection of HTTP cookies |
TCORSSupport | class | Cross-Origin Resource Sharing support |
TCustomSession | class | Base class for HTTP session management |
THTTPHeader | class | Base class for HTTP header management |
THTTPServerEvent | record | Server-sent event data structure |
TMimeItem | class | Represents a MIME multipart item |
TMimeItems | class | Collection of MIME multipart items |
TRequest | class | HTTP request representation |
TResponse | class | HTTP response representation |
TStreamingMimeItems | class | Collection for streaming MIME multipart items |
TUploadedFile | class | Represents an uploaded file in an HTTP request |
TUploadedFiles | class | Collection of uploaded files |
Procedures and functions
HTTPDecode | function | Decodes URL-encoded string |
HTTPEncode | function | Encodes string for URL transmission |
IncludeHTTPPathDelimiter | function | Ensures path ends with forward slash |
PayloadTooLarge | procedure |
Types
HTTPError | type | Creates an HTTP error exception |
RTLString | type | Runtime library string type |
TContentStreamingState | enumeration | Content streaming state enumeration |
TCORSOption | enumeration | Options for CORS (Cross-Origin Resource Sharing) configuration |
TCORSOptions | set | Set of CORS options |
THandleCORSOption | enumeration | Options for handling CORS requests |
THandleCORSOptions | set | Set of CORS handling options |
THttpFields | type | Array of HTTP header field names |
THttpIndexes | type | Array of HTTP header field indexes |
THTTPVariables | type | Set of HTTP variable types |
THTTPVariableType | enumeration | HTTP variable type enumeration |
THTTPVariableTypes | set | Set of HTTP variable types |
TMimeItemClass | type | Class type for MIME item instances |
TMimeItemsClass | type | Class type for MIME items collection |
TOnStreamEncodingEvent | procedure type | Event type for stream encoding processing |
TOnUnknownEncodingEvent | procedure type | Event type for handling unknown content encoding |
TRequestEvent | procedure type | Event procedure type for HTTP request handling |
TResponseEvent | procedure type | Event procedure type for HTTP response handling |
TSameSite | enumeration | Cookie SameSite attribute values |
TSessionState | enumeration | Enumeration of possible session states |
TSessionStates | set | Set of session states |
TStreamingContentType | enumeration | Content types for streaming HTTP data |
TUploadedFileClass | type | Class type for uploaded file instances |
TUploadedFilesClass | type | Class type for uploaded files collection |
Constants
DefaultAllowedHeaders | constant | Default set of allowed CORS headers |
DefaultAllowedMethods | constant | Default set of allowed CORS methods |
DefaultAllowedOrigins | constant | Default set of allowed CORS origins |
DefaultMaxBodySize | constant | |
DefaultMaxUploadFiles | constant | |
DefaultMaxUploadFileSize | constant | |
DefaultTimeOut | constant | Default timeout value in seconds |
fieldAccept | constant | Accept HTTP header field name |
FieldAcceptCharset | constant | Accept-Charset HTTP header field name |
FieldAcceptEncoding | constant | Accept-Encoding HTTP header field name |
FieldAcceptLanguage | constant | Accept-Language HTTP header field name |
FieldAcceptRanges | constant | Accept-Ranges HTTP header field name |
FieldAge | constant | Age HTTP header field name |
FieldAllow | constant | Allow HTTP header field name |
FieldAuthorization | constant | Authorization HTTP header field name |
FieldCacheControl | constant | Cache-Control HTTP header field name |
FieldConnection | constant | Connection HTTP header field name |
FieldContentEncoding | constant | Content-Encoding HTTP header field name |
FieldContentLanguage | constant | Content-Language HTTP header field name |
FieldContentLength | constant | Content-Length HTTP header field name |
FieldContentLocation | constant | Content-Location HTTP header field name |
FieldContentMD5 | constant | Content-MD5 HTTP header field name |
FieldContentRange | constant | Content-Range HTTP header field name |
FieldContentType | constant | Content-Type HTTP header field name |
FieldCookie | constant | Cookie HTTP header field name |
FieldDate | constant | Date HTTP header field name |
FieldETag | constant | ETag HTTP header field name |
FieldExpect | constant | Expect HTTP header field name |
FieldExpires | constant | Expires HTTP header field name |
FieldFrom | constant | From HTTP header field name |
FieldHost | constant | Host HTTP header field name |
FieldIfMatch | constant | If-Match HTTP header field name |
FieldIfModifiedSince | constant | If-Modified-Since HTTP header field name |
FieldIfNoneMatch | constant | If-None-Match HTTP header field name |
FieldIfRange | constant | If-Range HTTP header field name |
FieldIfUnModifiedSince | constant | If-Unmodified-Since HTTP header field name |
FieldLastModified | constant | Last-Modified HTTP header field name |
FieldLocation | constant | Location HTTP header field name |
FieldMaxForwards | constant | Max-Forwards HTTP header field name |
FieldPragma | constant | Pragma HTTP header field name |
FieldProxyAuthenticate | constant | Proxy-Authenticate HTTP header field name |
FieldProxyAuthorization | constant | Proxy-Authorization HTTP header field name |
FieldRange | constant | Range HTTP header field name |
FieldReferer | constant | Referer HTTP header field name |
FieldRetryAfter | constant | Retry-After HTTP header field name |
FieldServer | constant | Server HTTP header field name |
FieldSetCookie | constant | Set-Cookie HTTP header field name |
FieldTE | constant | TE HTTP header field name |
FieldTrailer | constant | Trailer HTTP header field name |
FieldTransferEncoding | constant | Transfer-Encoding HTTP header field name |
FieldUpgrade | constant | Upgrade HTTP header field name |
FieldUserAgent | constant | User-Agent HTTP header field name |
FieldVary | constant | Vary HTTP header field name |
FieldVia | constant | Via HTTP header field name |
FieldWarning | constant | Warning HTTP header field name |
FieldWWWAuthenticate | constant | WWW-Authenticate HTTP header field name |
FieldXRequestedWith | constant | X-Requested-With HTTP header field name |
HeaderBasedVariables | constant | Set of HTTP variables derived from header fields |
HTTPDateFmt | constant | HTTP date format string |
HTTPDays | constant | Array of day abbreviations for HTTP dates |
HTTPFieldIndexes | constant | Array of HTTP header field index mappings |
HTTPFieldNames | constant | Array of standard HTTP header field names |
HTTPMonths | constant | Array of month abbreviations for HTTP dates |
NoHTTPFields | constant | Number of HTTP header fields |
SCookieDomain | constant | Cookie domain attribute name |
SCookieExpire | constant | Cookie expires attribute name |
SCookieHttpOnly | constant | Cookie HttpOnly attribute name |
SCookiePath | constant | Cookie path attribute name |
SCookieSameSite | constant | Cookie SameSite attribute name |
SCookieSecure | constant | Cookie secure attribute name |
SFPWebSession | constant | Default session cookie name |
Variables
MimeItemClass | variable | Global variable for MIME item class type |
MimeItemsClass | variable | Global variable for MIME items class type |
UploadedFileClass | variable | Global variable for uploaded file class type |
UploadedFilesClass | variable | Global variable for uploaded files class type |
Topics
httpcookies | topic | Working with HTTP Cookies |
httpcors | topic | CORS Support Usage |
httpcorshandlerequest | topic | Understanding TCORSSupport.HandleRequest Return Value |
httprequestresponse | topic | Using TRequest and TResponse Classes |
httpsessions | topic | Working with HTTP Sessions |
Uses
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
