Class TBrookHTTPRequest

Unit

Declaration

type TBrookHTTPRequest = class(TBrookHandledPersistent)

Description

Class which provides headers, cookies, query-string, fields, payloads, uploads and other data sent by the client.

Hierarchy

Overview

Methods

Public constructor Create(AHandle: Pointer); virtual;
Public destructor Destroy; override;
Public function IsPost: Boolean; inline;
Public function IsFavicon: Boolean; inline;
Public function IsSecure: Boolean; inline;
Public function IsCachable: Boolean; inline;
Public function IsXhr: Boolean; inline;
Public procedure Isolate(AProc: TBrookHTTPRequestIsolatedProc; AUserData: Pointer = nil); virtual;

Properties

Public property ServerHandle: Pointer read FServerHandle;
Public property Headers: TBrookStringMap read FHeaders;
Public property Cookies: TBrookStringMap read FCookies;
Public property Params: TBrookStringMap read FParams;
Public property Fields: TBrookStringMap read FFields;
Public property Payload: TBrookString read FPayload;
Public property Version: string read FVersion;
Public property Method: string read FMethod;
Public property Path: string read FPath;
Public property IP: string read GetIP;
Public property ContentType: string read GetContentType;
Public property UserAgent: string read GetUserAgent;
Public property Referer: string read GetReferer;
Public property Paths: TArray<string> read GetPaths;
Public property IsIsolated: Boolean read FIsIsolated;
Public property IsUploading: Boolean read FIsUploading;
Public property Uploads: TBrookHTTPUploads read FUploads;
Public property Files: TBrookHTTPUploads read FUploads;
Public property Client: Pointer read FClient;
Public property TLSSession: Pointer read FTLSSession;
Public property UserData: Pointer read GetUserData write SetUserData;

Description

Methods

Public constructor Create(AHandle: Pointer); virtual;

Creates an instance of TBrookHTTPRequest.

Parameters
AHandle[in]
Request handle.
Public destructor Destroy; override;

Frees an instance of TBrookHTTPRequest.

Public function IsPost: Boolean; inline;

Checks if the HTTP method is POST, PUT, DELETE or OPTIONS.

Public function IsFavicon: Boolean; inline;

Checks if current path refers to '/favicon.ico'.

Public function IsSecure: Boolean; inline;

Checks if request contains a valid TLS session.

Public function IsCachable: Boolean; inline;

Checks if the HTTP method is HEAD or GET.

Public function IsXhr: Boolean; inline;

Checks if the request was done by an Ajax client.

Public procedure Isolate(AProc: TBrookHTTPRequestIsolatedProc; AUserData: Pointer = nil); virtual;

Isolates a request from the main event loop to an own dedicated thread, bringing it back when the request finishes.

Parameters
AProc[in]
Procedure to handle requests and responses isolated from the main event loop.
AUserData[in]
User-defined data.

Properties

Public property ServerHandle: Pointer read FServerHandle;

Reference to the server instance.

Public property Headers: TBrookStringMap read FHeaders;

Hash table containing the request headers.

Public property Cookies: TBrookStringMap read FCookies;

Hash table containing the request cookies.

Public property Params: TBrookStringMap read FParams;

Hash table containing the request parameters (query-string).

Public property Fields: TBrookStringMap read FFields;

Hash table containing the request fields (HTML form fields).

Public property Payload: TBrookString read FPayload;

String buffer containing the request payload.

Public property Version: string read FVersion;

Contains the requested HTTP version.

Public property Method: string read FMethod;

Contains the requested HTTP method.

Public property Path: string read FPath;

Contains the path component.

Public property IP: string read GetIP;

Contains the client IP.

Public property ContentType: string read GetContentType;

Contains the requested Content-Type.

Public property UserAgent: string read GetUserAgent;

Contains the client User-Agent.

Public property Referer: string read GetReferer;

Where the request originated.

Public property Paths: TArray<string> read GetPaths;

Contains the levels of the path component.

Public property IsIsolated: Boolean read FIsIsolated;

Checks if the request was isolated from the main event loop to an own dedicated thread.

Public property IsUploading: Boolean read FIsUploading;

Checks if the client is uploading data.

Public property Uploads: TBrookHTTPUploads read FUploads;

List of the uploaded files.

Public property Files: TBrookHTTPUploads read FUploads;

List of the uploaded files. This is an alias to property Uploads.

Public property Client: Pointer read FClient;

Contains the socket handle of the client.

Public property TLSSession: Pointer read FTLSSession;

Contains the TLS session handle (GnuTLS).

Public property UserData: Pointer read GetUserData write SetUserData;

User-defined data to be stored temporally in the request object.


Generated by PasDoc 0.16.0.