Indy 9 | Content | Index | Reference

TIdHTTPServer
Hierarchy, Properties, Methods, Events, See Also, Unit: IdHTTPServer
Implements an HTTP Server.

    TIdHTTPServer = class(TIdCustomHTTPServer)

Unit
IdHTTPServer
Description
TIdHTTPServer is a TIdCustomHTTPServer descendant that is a server implementation of the Hypertext Transfer Protocol (HTTP) as described in the Internet Standards document:

- RFC 1945 - Hypertext Transfer Protocol (HTTP) version 1.0 (http://www.rfc-editor.org/rfc/rfc1945.txt)

- RFC 2616 - Hypertext Transfer Protocol (HTTP) version 1.1 (http://www.rfc-editor.org/rfc/rfc2616.txt)

TIdHTTPServer publishes the inherited OnCreatePostStream and OnCommandGet event handlers for the HTTP server implementation.

TIdHTTPServer also supports the Secure Hypertext Transport protocol (HTTPS) as described in the Internet Standards document:

- RFC 2660 - The Secure HyperText Transfer Protocol (http://www.rfc-editor.org/rfc/rfc2660.txt)

Assign an instance of TIdServerInterceptOpenSSL to the Intercept property to allow use of the HTTPS protocol. For the Windows platform, you must install the Indy OpenSSL support .DLL's available at http://www.intelicom.si to enable Secure Socket Layer support.

TIdHTTPServer.OnCommandGet
TIdHTTPServer, See Also
Event handler signalled for HTTP server GET, POST, and HEAD requests.

    property OnCommandGet;

Parameters
AThread
The peer thread generating the event.
RequestInfo
The request object reference.
ResponseInfo
The response object reference.
Description
OnCommandGet is the TIdHTTPGetEvent event handler used to respond to events generated for the HTTP server GET, POST, and HEAD commands. OnCommandGet is published in TIdHTTPServer, and is used during execution of the client thread to form an HTTP response to the HTTP request from the client connection.

The server implementation may assign a procedure to the OnCommandGet event handler to allow the server to respond to the HTTP commands. Note: When OnCommandGet is unassigned, the HTTP request will be read from the client connection and an HTTP prototcol error will be sent in the HTTP reponse.

OnCommandGet can be used to manipulate properties and methods of the RequestInfo and ResponseInfo parameters prior to allowing the server to send the response to the HTTP client.

TIdHTTPServer.OnCreatePostStream
TIdHTTPServer, See Also
Event handler tht allows creation of the POST stream for a client thread.

    property OnCreatePostStream;

Parameters
ASender
theraded client conncetion for the event notification.
VPostStream
steam allocated for the HTTP post request.
Description
OnCreatePostStream is a TOnCreatePostStream property that represents the event handler triggered when a client thread needs to create a stream used in an HTTP POST request. OnCreatePostStream is used during execution of the thread client connection identified by ASender. OnCreatePostStream is a published property in TIdHTTPServer.

The server implementation may assign a procedure to the event handler to allow responding to the event notification. The event handler can perform processing required prior to creation of a stream class instance. The event handler can create and assign a stream class instance to VPostStream when appropriate, or retun the value Nil. If VPostStream is unassigned, a TStringStream instance will be created prior to execution of a command handler for the HTTP POST request.

Created with Doc-O-Matic 2 donated to Project JEDI. Commercial license available from the Doc-O-Matic site.