Class TBrookHttpDef

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TBrookHttpDef = class(TBrookObject)

Description

Offers general abstract features for HTTP handling.

Hierarchy

Overview

Methods

Public constructor Create; virtual; abstract;
Public class procedure Register;
Public class procedure Unregister;
Public class function GetLibrary: string; virtual; abstract;
Public procedure AddHeader(const AName, AValue: string); virtual; abstract;
Public function Request: Boolean; virtual; abstract;
Public class function Get(const AUrl: string; AResponse: TStream): Boolean; virtual; abstract;
Public class function Post(const AUrl: string; AResponse: TStream): Boolean; virtual; abstract;
Public class function Put(const AUrl: string; AResponse: TStream): Boolean; virtual; abstract;
Public class function Delete(const AUrl: string; AResponse: TStream): Boolean; virtual; abstract;
Public class function Options(const AUrl: string; AResponse: TStream): Boolean; virtual; abstract;
Public class function Head(const AUrl: string; AHeaders: TStrings): Boolean; virtual; abstract;
Public class function PostForm(const AUrl: string; AFormData, AResponse: TStream): Boolean; virtual; abstract;
Public class function PostForm(const AUrl, AFormData: string; AResponse: TStream): Boolean; virtual; abstract;
Public class function PostFile(const AUrl, AFieldName, AFileName: string; AFile, AResponse: TStream): Boolean; virtual; abstract;
Public class function PostFile(const AUrl, AFieldName, AFileName: string; AResponse: TStream): Boolean; virtual; abstract;

Properties

Public property ContentType: string read GetContentType write SetContentType;
Public property Contents: TStrings read GetContents;
Public property Cookies: TStrings read GetCookies;
Public property Document: TStream read GetDocument;
Public property Headers: TStrings read GetHeaders;
Public property StatusCode: Integer read GetStatusCode;
Public property ReasonPhrase: string read GetReasonPhrase;
Public property Method: string read GetMethod write SetMethod;
Public property Url: string read GetUrl write SetUrl;
Public property Client: TObject read GetClient;

Description

Methods

Public constructor Create; virtual; abstract;

Creates an instance of a TBrookHttpDef class.

Public class procedure Register;

Register the broker class.

Public class procedure Unregister;

Unregister the broker class.

Public class function GetLibrary: string; virtual; abstract;

Get the broker library name, for example: FCLWeb, Synapse, LNet, Indy etc.

Public procedure AddHeader(const AName, AValue: string); virtual; abstract;

Adds header, replacing an existing one if it exists.

Public function Request: Boolean; virtual; abstract;

Sends request to server.

Public class function Get(const AUrl: string; AResponse: TStream): Boolean; virtual; abstract;

Sends request by a GET HTTP request method.

Public class function Post(const AUrl: string; AResponse: TStream): Boolean; virtual; abstract;

Sends request by a POST HTTP request method.

Public class function Put(const AUrl: string; AResponse: TStream): Boolean; virtual; abstract;

Sends request by a PUT HTTP request method.

Public class function Delete(const AUrl: string; AResponse: TStream): Boolean; virtual; abstract;

Sends request by a DELETE HTTP request method.

Public class function Options(const AUrl: string; AResponse: TStream): Boolean; virtual; abstract;

Sends request by an OPTIONS HTTP request method.

Public class function Head(const AUrl: string; AHeaders: TStrings): Boolean; virtual; abstract;

Sends request by a HEAD HTTP request method.

Public class function PostForm(const AUrl: string; AFormData, AResponse: TStream): Boolean; virtual; abstract;

Sends request by a POST HTTP request method, passing a form-data as parameter.

Public class function PostForm(const AUrl, AFormData: string; AResponse: TStream): Boolean; virtual; abstract;

Sends request by a POST HTTP request method, passing a form-data as parameter.

Public class function PostFile(const AUrl, AFieldName, AFileName: string; AFile, AResponse: TStream): Boolean; virtual; abstract;

Sends request by a POST HTTP request method, passing a file as parameter.

Public class function PostFile(const AUrl, AFieldName, AFileName: string; AResponse: TStream): Boolean; virtual; abstract;

Sends request by a POST HTTP request method, passing a file as parameter.

Properties

Public property ContentType: string read GetContentType write SetContentType;

Content type of sending data.

Public property Contents: TStrings read GetContents;

Strings received from the request.

Public property Cookies: TStrings read GetCookies;

Set cookies to be sent and/or received from the server.

Public property Document: TStream read GetDocument;

Document received from the request.

Public property Headers: TStrings read GetHeaders;

Request headers.

Public property StatusCode: Integer read GetStatusCode;

Result code after successful request.

Public property ReasonPhrase: string read GetReasonPhrase;

Result text after successful request.

Public property Method: string read GetMethod write SetMethod;

Method for requests.

Public property Url: string read GetUrl write SetUrl;

URL that request is driven to.

Public property Client: TObject read GetClient;

Is the instance of the HTTP client broker.