Skip to content

THTTPHeader

Base class for HTTP header management

Declaration

Source position: httpdefs.pp line 353

type

  THTTPHeader = class(TObject)
  public
    constructor Create;
    destructor Destroy;
    function HeaderIsSet : Boolean;
    function GetHeader : string;
    procedure SetHeader;
    procedure SetFieldByName;
    function GetFieldByName : string;
    class function GetVariableHeaderName : string;
    class function GetVariableHeaderType : THTTPVariableType;
    class function ParseContentType : string;
    function GetCustomHeader : string;
    procedure SetCustomHeader;
    function LoadFromStream : Integer;
    function LoadFromStrings : Integer;
    property FieldCount: Integer; {r}
    property Fields[AIndex : Integer]: string; {r}
    property FieldNames[AIndex : Integer]: string; {r}
    property FieldValues[AIndex : Integer]: string; {r}
    property Accept: string; {rw}
    property AcceptCharset: string; {rw}
    property AcceptEncoding: string; {rw}
    property AcceptLanguage: string; {rw}
    property Authorization: string; {rw}
    property Connection: string; {rw}
    property ContentEncoding: string; {rw}
    property ContentLanguage: string; {rw}
    property ContentLength: Int64; {rw}
    property ContentType: string; {rw}
    property Date: string; {rw}
    property Expires: string; {rw}
    property From: string; {rw}
    property Host: string; {rw}
    property IfModifiedSince: string; {rw}
    property LastModified: string; {rw}
    property Location: string; {rw}
    property Pragma: string; {rw}
    property Referer: string; {rw}
    property RetryAfter: string; {rw}
    property Server: string; {rw}
    property UserAgent: string; {rw}
    property Warning: string; {rw}
    property WWWAuthenticate: string; {rw}
    property Via: string; {rw}
    property HTTPAccept: string; {rw}
    property HTTPAcceptCharset: string; {rw}
    property HTTPAcceptEncoding: string; {rw}
    property HTTPIfModifiedSince: string; {rw}
    property HTTPReferer: string; {rw}
    property HTTPUserAgent: string; {rw}
    property Cookie: string; {rw}
    property SetCookie: string; {rw}
    property HTTPXRequestedWith: string; {rw}
    property HttpVersion: string; {rw}
    property ProtocolVersion: string; {rw}
    property PathInfo: string; {rw}
    property PathTranslated: string; {rw}
    property RemoteAddress: string; {rw}
    property RemoteAddr: string; {rw}
    property RemoteHost: string; {rw}
    property ScriptName: string; {rw}
    property ServerPort: Word; {rw}
    property Method: string; {rw}
    property URL: string; {rw}
    property Query: string; {rw}
    property Content: string; {rw}
    property ContentBytes: TBytes; {rw}
    property CookieFields: TStrings; {rw}
    property ContentFields: TStrings; {r}
    property QueryFields: TStrings; {r}
    property CustomHeaders: TStringList; {r}
  end;

Description

THTTPHeader provides common functionality for handling HTTP headers, variables, and content. It serves as the base class for both TRequest and TResponse classes.

Properties

Member Visibility Description
Accept public Accept header field value
AcceptCharset public Accept-Charset header field value
AcceptEncoding public Accept-Encoding header field value
AcceptLanguage public Accept-Language header field value
Authorization public Authorization header field value
Connection public Connection header field value
Content public Request content as string
ContentBytes public Request content as byte array
ContentEncoding public Content-Encoding header field value
ContentFields read only public Collection of content form fields
ContentLanguage public Content-Language header field value
ContentLength public Content-Length header field value
ContentType public Content-Type header field value
Cookie public Cookie header field value
CookieFields public Collection of cookie name-value pairs
CustomHeaders read only public Collection of custom header fields
Date public Date header field value
Expires public Expires header field value
FieldCount read only public Number of header fields
FieldNames read only public Name of the header field at the specified index
Fields read only public Header field name and value at the specified index
FieldValues read only public Value of the header field at the specified index
From public From header field value
Host public Host header field value
HTTPAccept public HTTP Accept header accessor property
HTTPAcceptCharset public HTTP Accept-Charset header accessor property
HTTPAcceptEncoding public HTTP Accept-Encoding header accessor property
HTTPIfModifiedSince public HTTP If-Modified-Since header accessor property
HTTPReferer public HTTP Referer header accessor property
HTTPUserAgent public HTTP User-Agent header accessor property
HttpVersion public HTTP protocol version
HTTPXRequestedWith public HTTP X-Requested-With header accessor property
IfModifiedSince public If-Modified-Since header field value
LastModified public Last-Modified header field value
Location public Location header field value
Method public HTTP request method
PathInfo public PATH_INFO environment variable value
PathTranslated public PATH_TRANSLATED environment variable value
Pragma public Pragma header field value
ProtocolVersion public Protocol version string
Query public QUERY_STRING environment variable value
QueryFields read only public Collection of query string name-value pairs
Referer public Referer header field value
RemoteAddr public Alias for RemoteAddress property
RemoteAddress public REMOTE_ADDR environment variable value
RemoteHost public REMOTE_HOST environment variable value
RetryAfter public Retry-After header field value
ScriptName public SCRIPT_NAME environment variable value
Server public Server header field value
ServerPort public SERVER_PORT environment variable value
SetCookie public Set-Cookie header field value
URL public Complete request URL
UserAgent public User-Agent header field value
Via public Via header field value
Warning public Warning header field value
WWWAuthenticate public WWW-Authenticate header field value
See all Properties

Methods

Member Visibility Description
Create public Creates an HTTP header instance
Destroy public Destroys the HTTP header instance
GetCustomHeader public Gets a custom header field value by name
GetFieldByName public Gets a header field value by field name
GetHeader public Gets the value of a specific header field
GetVariableHeaderName public Gets the header field name for an HTTP variable type
GetVariableHeaderType public Gets the HTTP variable type for a header field name
HeaderIsSet public Checks if a specific header field is set
LoadFromStream public Loads HTTP headers from a stream
LoadFromStrings public Loads HTTP headers from a string list
ParseContentType public Parses a content type header value
SetCustomHeader public Sets a custom header field value by name
SetFieldByName public Sets a header field value by field name
SetHeader public Sets the value of a specific header field
See all Methods

See also

Name Description
TRequest HTTP request representation
TResponse HTTP response representation