TIPHTTPResponseHeaders

Overview

The TIPHTTPResponseHeaders class represents a collection of HTTP Response headers of the response in progress.

You can use this class in custom HTTP Servers. For example, in the Remoting SDK, the TIPHTTPResponseHeaders class is used in the TROBaseSuperHTTPServer and TROIndyHTTPServer servers.

Location

Implements

 

constructor Create

Creates a new instance with a new empty collection of Headers and the default value of the Version property ("HTTP/1.1").

constructor Create

Assign

Assigns the Headers, Code, Version and Reason properties with corresponding properties of the specified aOrg object.

procedure Assign(aOrg: TIPHTTPResponseHeaders)

Parameters:

  • aOrg: Specified TIPHTTPResponseHeaders object that will be assigned

Clear

Clears the collection of Headers and sets the Code property to the value 200, Version to HTTP/1.1 and Reason to OK.

procedure Clear

Code

Represents the numeric response code of the current response.

property Code: Integer read write

ContentType

Represents the Content-Type entity-header of the current response.

property ContentType: string read write

Headers

Represents the collection of headers of the current response in "Name=Value" format. This property is read-only.

property Headers: TStrings read write

Reason

Represents the reason of the current response. For example, if there was an internal problem on the server side while processing the request, Reason will equal 'Internal Error'.

property Reason: string read write

ToString

Represent the current TIPHTTPResponseHeaders object in the following string format:

Version Code Reason
LHeader1Name:LHeader1Value
. . .
LHeaderNName:LHeaderNValue

For example:
HTTP/1.1 200 OK
Content-Length: 348
. . .
Content-Type: text/html; charset=utf-8

function ToString: string

Version

Represents the HTTP response version. Equals "HTTP/1.1" by default.

property Version: string read write

 

Code

Represents the numeric response code of the current response.

property Code: Integer read write

ContentType

Represents the Content-Type entity-header of the current response.

property ContentType: string read write

Headers

Represents the collection of headers of the current response in "Name=Value" format. This property is read-only.

property Headers: TStrings read write

Reason

Represents the reason of the current response. For example, if there was an internal problem on the server side while processing the request, Reason will equal 'Internal Error'.

property Reason: string read write

Version

Represents the HTTP response version. Equals "HTTP/1.1" by default.

property Version: string read write

 

constructor Create

Creates a new instance with a new empty collection of Headers and the default value of the Version property ("HTTP/1.1").

constructor Create

Assign

Assigns the Headers, Code, Version and Reason properties with corresponding properties of the specified aOrg object.

procedure Assign(aOrg: TIPHTTPResponseHeaders)

Parameters:

  • aOrg: Specified TIPHTTPResponseHeaders object that will be assigned

Clear

Clears the collection of Headers and sets the Code property to the value 200, Version to HTTP/1.1 and Reason to OK.

procedure Clear

ToString

Represent the current TIPHTTPResponseHeaders object in the following string format:

Version Code Reason
LHeader1Name:LHeader1Value
. . .
LHeaderNName:LHeaderNValue

For example:
HTTP/1.1 200 OK
Content-Length: 348
. . .
Content-Type: text/html; charset=utf-8

function ToString: string

See Also