Sign in Join
FPDoc Onlineexperiment

HTTPProtocol unit

HTTP protocol utilities and constants.

This unit provides HTTP 1.1 protocol definitions, constants, and utility functions for web applications. It includes:

  • HTTP header type definitions and string constants
  • URL encoding and decoding functions
  • HTTP status code text lookup
  • HTTP date/time parsing utilities
  • Cookie formatting constants

Procedures and functions

ExcludeHTTPPathDelimiterfunctionRemoves trailing forward slash from a URL path.
GetHTTPStatusTextfunctionReturns descriptive text for HTTP status codes.
HeaderNamefunctionReturns the string name of an HTTP header.
HeaderTypefunctionReturns the header type for a given header string.
HTTPDecodefunctionDecodes HTTP URL-encoded strings.
HTTPEncodefunctionEncodes strings for HTTP URL transmission.
IncludeHTTPPathDelimiterfunctionEnsures a URL path ends with a forward slash.
ParseHTTPDateTimefunctionParses HTTP date/time strings to TDateTime.

Types

THeaderenumerationEnumeration of standard HTTP 1.1 headers.
THeaderDirectionenumerationDirection of HTTP header usage.
THeaderDirectionssetSet of header direction values.
THeaderssetSet of HTTP headers.
THeadersArraytypeArray of header name strings indexed by THeader.
THTTPUnsafeChartypeType for representing unsafe characters in HTTP encoding.
THTTPUnsafeCharssetSet of characters that are unsafe for HTTP URLs.

Constants

HeaderAcceptconstantAccept header name string.
HeaderAcceptCharsetconstantAccept-Charset header name string.
HeaderAcceptEncodingconstantAccept-Encoding header name string.
HeaderAcceptLanguageconstantAccept-Language header name string.
HeaderAcceptRangesconstantAccept-Ranges header name string.
HeaderAgeconstantAge header name string.
HeaderAllowconstantAllow header name string.
HeaderAuthorizationconstantAuthorization header name string.
HeaderCacheControlconstantCache-Control header name string.
HeaderConnectionconstantConnection header name string.
HeaderContentEncodingconstantContent-Encoding header name string.
HeaderContentLanguageconstantContent-Language header name string.
HeaderContentLengthconstantContent-Length header name string.
HeaderContentLocationconstantContent-Location header name string.
HeaderContentMD5constantContent-MD5 header name string.
HeaderContentRangeconstantContent-Range header name string.
HeaderContentTypeconstantContent-Type header name string.
HeaderCookieconstantCookie header name constant.
HeaderDateconstantDate header name string.
HeaderETagconstantETag header name string.
HeaderExpectconstantExpect header name string.
HeaderExpiresconstantExpires header name string.
HeaderFromconstantFrom header name string.
HeaderHostconstantHost header name string.
HeaderIfMatchconstantIf-Match header name string.
HeaderIfModifiedSinceconstantIf-Modified-Since header name string.
HeaderIfNoneMatchconstantIf-None-Match header name string.
HeaderIfRangeconstantIf-Range header name string.
HeaderIfUnModifiedSinceconstantIf-Unmodified-Since header name string.
HeaderLastModifiedconstantLast-Modified header name string.
HeaderLocationconstantLocation header name string.
HeaderMaxForwardsconstantMax-Forwards header name string.
HeaderPragmaconstantPragma header name string.
HeaderProxyAuthenticateconstantProxy-Authenticate header name string.
HeaderProxyAuthorizationconstantProxy-Authorization header name string.
HeaderRangeconstantRange header name string.
HeaderRefererconstantReferer header name string.
HeaderRetryAfterconstantRetry-After header name string.
HeaderServerconstantServer header name string.
HeaderSetCookieconstantSet-Cookie header name constant.
HeaderTEconstantTE header name string.
HeaderTrailerconstantTrailer header name string.
HeaderTransferEncodingconstantTransfer-Encoding header name string.
HeaderUpgradeconstantUpgrade header name string.
HeaderUserAgentconstantUser-Agent header name string.
HeaderVaryconstantVary header name string.
HeaderViaconstantVia header name string.
HeaderWarningconstantWarning header name string.
HeaderWWWAuthenticateconstantWWW-Authenticate header name string.
HeaderXRequestedWithconstantX-Requested-With header name string.
HTTPDateFmtconstantFormat string for HTTP date formatting.
HTTPDaysconstantArray of 3-letter day abbreviations for HTTP dates.
HTTPHeaderDirectionsconstantArray defining which direction each header type is used in.
HTTPHeaderNamesconstantArray mapping header types to their string names.
HTTPMonthsconstantArray of 3-letter month abbreviations for HTTP dates.
SCookieDomainconstantFormat string for cookie domain attribute.
SCookieExpireconstantFormat string for cookie expiration date.
SCookieHttpOnlyconstantString for cookie HttpOnly attribute.
SCookiePathconstantFormat string for cookie path attribute.
SCookieSameSiteconstantString for cookie SameSite attribute.
SCookieSecureconstantString for cookie Secure attribute.

Uses

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