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
ExcludeHTTPPathDelimiter | function | Removes trailing forward slash from a URL path. |
GetHTTPStatusText | function | Returns descriptive text for HTTP status codes. |
HeaderName | function | Returns the string name of an HTTP header. |
HeaderType | function | Returns the header type for a given header string. |
HTTPDecode | function | Decodes HTTP URL-encoded strings. |
HTTPEncode | function | Encodes strings for HTTP URL transmission. |
IncludeHTTPPathDelimiter | function | Ensures a URL path ends with a forward slash. |
ParseHTTPDateTime | function | Parses HTTP date/time strings to TDateTime. |
Types
THeader | enumeration | Enumeration of standard HTTP 1.1 headers. |
THeaderDirection | enumeration | Direction of HTTP header usage. |
THeaderDirections | set | Set of header direction values. |
THeaders | set | Set of HTTP headers. |
THeadersArray | type | Array of header name strings indexed by THeader. |
THTTPUnsafeChar | type | Type for representing unsafe characters in HTTP encoding. |
THTTPUnsafeChars | set | Set of characters that are unsafe for HTTP URLs. |
Constants
HeaderAccept | constant | Accept header name string. |
HeaderAcceptCharset | constant | Accept-Charset header name string. |
HeaderAcceptEncoding | constant | Accept-Encoding header name string. |
HeaderAcceptLanguage | constant | Accept-Language header name string. |
HeaderAcceptRanges | constant | Accept-Ranges header name string. |
HeaderAge | constant | Age header name string. |
HeaderAllow | constant | Allow header name string. |
HeaderAuthorization | constant | Authorization header name string. |
HeaderCacheControl | constant | Cache-Control header name string. |
HeaderConnection | constant | Connection header name string. |
HeaderContentEncoding | constant | Content-Encoding header name string. |
HeaderContentLanguage | constant | Content-Language header name string. |
HeaderContentLength | constant | Content-Length header name string. |
HeaderContentLocation | constant | Content-Location header name string. |
HeaderContentMD5 | constant | Content-MD5 header name string. |
HeaderContentRange | constant | Content-Range header name string. |
HeaderContentType | constant | Content-Type header name string. |
HeaderCookie | constant | Cookie header name constant. |
HeaderDate | constant | Date header name string. |
HeaderETag | constant | ETag header name string. |
HeaderExpect | constant | Expect header name string. |
HeaderExpires | constant | Expires header name string. |
HeaderFrom | constant | From header name string. |
HeaderHost | constant | Host header name string. |
HeaderIfMatch | constant | If-Match header name string. |
HeaderIfModifiedSince | constant | If-Modified-Since header name string. |
HeaderIfNoneMatch | constant | If-None-Match header name string. |
HeaderIfRange | constant | If-Range header name string. |
HeaderIfUnModifiedSince | constant | If-Unmodified-Since header name string. |
HeaderLastModified | constant | Last-Modified header name string. |
HeaderLocation | constant | Location header name string. |
HeaderMaxForwards | constant | Max-Forwards header name string. |
HeaderPragma | constant | Pragma header name string. |
HeaderProxyAuthenticate | constant | Proxy-Authenticate header name string. |
HeaderProxyAuthorization | constant | Proxy-Authorization header name string. |
HeaderRange | constant | Range header name string. |
HeaderReferer | constant | Referer header name string. |
HeaderRetryAfter | constant | Retry-After header name string. |
HeaderServer | constant | Server header name string. |
HeaderSetCookie | constant | Set-Cookie header name constant. |
HeaderTE | constant | TE header name string. |
HeaderTrailer | constant | Trailer header name string. |
HeaderTransferEncoding | constant | Transfer-Encoding header name string. |
HeaderUpgrade | constant | Upgrade header name string. |
HeaderUserAgent | constant | User-Agent header name string. |
HeaderVary | constant | Vary header name string. |
HeaderVia | constant | Via header name string. |
HeaderWarning | constant | Warning header name string. |
HeaderWWWAuthenticate | constant | WWW-Authenticate header name string. |
HeaderXRequestedWith | constant | X-Requested-With header name string. |
HTTPDateFmt | constant | Format string for HTTP date formatting. |
HTTPDays | constant | Array of 3-letter day abbreviations for HTTP dates. |
HTTPHeaderDirections | constant | Array defining which direction each header type is used in. |
HTTPHeaderNames | constant | Array mapping header types to their string names. |
HTTPMonths | constant | Array of 3-letter month abbreviations for HTTP dates. |
SCookieDomain | constant | Format string for cookie domain attribute. |
SCookieExpire | constant | Format string for cookie expiration date. |
SCookieHttpOnly | constant | String for cookie HttpOnly attribute. |
SCookiePath | constant | Format string for cookie path attribute. |
SCookieSameSite | constant | String for cookie SameSite attribute. |
SCookieSecure | constant | String for cookie Secure attribute. |
Uses
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
