Sign in Join
FPDoc Onlineexperiment

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

EHTTPclassHTTP exception class
TCookieclassHTTP cookie implementation
TCookiesclassCollection of HTTP cookies
TCORSSupportclassCross-Origin Resource Sharing support
TCustomSessionclassBase class for HTTP session management
THTTPHeaderclassBase class for HTTP header management
THTTPServerEventrecordServer-sent event data structure
TMimeItemclassRepresents a MIME multipart item
TMimeItemsclassCollection of MIME multipart items
TRequestclassHTTP request representation
TResponseclassHTTP response representation
TStreamingMimeItemsclassCollection for streaming MIME multipart items
TUploadedFileclassRepresents an uploaded file in an HTTP request
TUploadedFilesclassCollection of uploaded files

Procedures and functions

HTTPDecodefunctionDecodes URL-encoded string
HTTPEncodefunctionEncodes string for URL transmission
IncludeHTTPPathDelimiterfunctionEnsures path ends with forward slash
PayloadTooLargeprocedure

Types

HTTPErrortypeCreates an HTTP error exception
RTLStringtypeRuntime library string type
TContentStreamingStateenumerationContent streaming state enumeration
TCORSOptionenumerationOptions for CORS (Cross-Origin Resource Sharing) configuration
TCORSOptionssetSet of CORS options
THandleCORSOptionenumerationOptions for handling CORS requests
THandleCORSOptionssetSet of CORS handling options
THttpFieldstypeArray of HTTP header field names
THttpIndexestypeArray of HTTP header field indexes
THTTPVariablestypeSet of HTTP variable types
THTTPVariableTypeenumerationHTTP variable type enumeration
THTTPVariableTypessetSet of HTTP variable types
TMimeItemClasstypeClass type for MIME item instances
TMimeItemsClasstypeClass type for MIME items collection
TOnStreamEncodingEventprocedure typeEvent type for stream encoding processing
TOnUnknownEncodingEventprocedure typeEvent type for handling unknown content encoding
TRequestEventprocedure typeEvent procedure type for HTTP request handling
TResponseEventprocedure typeEvent procedure type for HTTP response handling
TSameSiteenumerationCookie SameSite attribute values
TSessionStateenumerationEnumeration of possible session states
TSessionStatessetSet of session states
TStreamingContentTypeenumerationContent types for streaming HTTP data
TUploadedFileClasstypeClass type for uploaded file instances
TUploadedFilesClasstypeClass type for uploaded files collection

Constants

DefaultAllowedHeadersconstantDefault set of allowed CORS headers
DefaultAllowedMethodsconstantDefault set of allowed CORS methods
DefaultAllowedOriginsconstantDefault set of allowed CORS origins
DefaultMaxBodySizeconstant
DefaultMaxUploadFilesconstant
DefaultMaxUploadFileSizeconstant
DefaultTimeOutconstantDefault timeout value in seconds
fieldAcceptconstantAccept HTTP header field name
FieldAcceptCharsetconstantAccept-Charset HTTP header field name
FieldAcceptEncodingconstantAccept-Encoding HTTP header field name
FieldAcceptLanguageconstantAccept-Language HTTP header field name
FieldAcceptRangesconstantAccept-Ranges HTTP header field name
FieldAgeconstantAge HTTP header field name
FieldAllowconstantAllow HTTP header field name
FieldAuthorizationconstantAuthorization HTTP header field name
FieldCacheControlconstantCache-Control HTTP header field name
FieldConnectionconstantConnection HTTP header field name
FieldContentEncodingconstantContent-Encoding HTTP header field name
FieldContentLanguageconstantContent-Language HTTP header field name
FieldContentLengthconstantContent-Length HTTP header field name
FieldContentLocationconstantContent-Location HTTP header field name
FieldContentMD5constantContent-MD5 HTTP header field name
FieldContentRangeconstantContent-Range HTTP header field name
FieldContentTypeconstantContent-Type HTTP header field name
FieldCookieconstantCookie HTTP header field name
FieldDateconstantDate HTTP header field name
FieldETagconstantETag HTTP header field name
FieldExpectconstantExpect HTTP header field name
FieldExpiresconstantExpires HTTP header field name
FieldFromconstantFrom HTTP header field name
FieldHostconstantHost HTTP header field name
FieldIfMatchconstantIf-Match HTTP header field name
FieldIfModifiedSinceconstantIf-Modified-Since HTTP header field name
FieldIfNoneMatchconstantIf-None-Match HTTP header field name
FieldIfRangeconstantIf-Range HTTP header field name
FieldIfUnModifiedSinceconstantIf-Unmodified-Since HTTP header field name
FieldLastModifiedconstantLast-Modified HTTP header field name
FieldLocationconstantLocation HTTP header field name
FieldMaxForwardsconstantMax-Forwards HTTP header field name
FieldPragmaconstantPragma HTTP header field name
FieldProxyAuthenticateconstantProxy-Authenticate HTTP header field name
FieldProxyAuthorizationconstantProxy-Authorization HTTP header field name
FieldRangeconstantRange HTTP header field name
FieldRefererconstantReferer HTTP header field name
FieldRetryAfterconstantRetry-After HTTP header field name
FieldServerconstantServer HTTP header field name
FieldSetCookieconstantSet-Cookie HTTP header field name
FieldTEconstantTE HTTP header field name
FieldTrailerconstantTrailer HTTP header field name
FieldTransferEncodingconstantTransfer-Encoding HTTP header field name
FieldUpgradeconstantUpgrade HTTP header field name
FieldUserAgentconstantUser-Agent HTTP header field name
FieldVaryconstantVary HTTP header field name
FieldViaconstantVia HTTP header field name
FieldWarningconstantWarning HTTP header field name
FieldWWWAuthenticateconstantWWW-Authenticate HTTP header field name
FieldXRequestedWithconstantX-Requested-With HTTP header field name
HeaderBasedVariablesconstantSet of HTTP variables derived from header fields
HTTPDateFmtconstantHTTP date format string
HTTPDaysconstantArray of day abbreviations for HTTP dates
HTTPFieldIndexesconstantArray of HTTP header field index mappings
HTTPFieldNamesconstantArray of standard HTTP header field names
HTTPMonthsconstantArray of month abbreviations for HTTP dates
NoHTTPFieldsconstantNumber of HTTP header fields
SCookieDomainconstantCookie domain attribute name
SCookieExpireconstantCookie expires attribute name
SCookieHttpOnlyconstantCookie HttpOnly attribute name
SCookiePathconstantCookie path attribute name
SCookieSameSiteconstantCookie SameSite attribute name
SCookieSecureconstantCookie secure attribute name
SFPWebSessionconstantDefault session cookie name

Variables

MimeItemClassvariableGlobal variable for MIME item class type
MimeItemsClassvariableGlobal variable for MIME items class type
UploadedFileClassvariableGlobal variable for uploaded file class type
UploadedFilesClassvariableGlobal variable for uploaded files class type

Topics

httpcookiestopicWorking with HTTP Cookies
httpcorstopicCORS Support Usage
httpcorshandlerequesttopicUnderstanding TCORSSupport.HandleRequest Return Value
httprequestresponsetopicUsing TRequest and TResponse Classes
httpsessionstopicWorking with HTTP Sessions

Uses

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