Class TBrookHttpDef

Unit

Declaration

type TBrookHttpDef = class(TBrookObject)

Description

Offers general abstract features for HTTP handling.

Hierarchy

Overview

Methods

Protected procedure SetContentType(AValue: string); virtual; abstract;
Protected function GetContentType: string; virtual; abstract;
Protected function GetClient: TObject; virtual; abstract;
Protected function GetContents: TStrings; virtual; abstract;
Protected function GetCookies: TStrings; virtual; abstract;
Protected function GetDocument: TStream; virtual; abstract;
Protected function GetHeaders: TStrings; virtual; abstract;
Protected function GetReasonPhrase: string; virtual; abstract;
Protected function GetStatusCode: Integer; virtual; abstract;
Protected function GetMethod: string; virtual; abstract;
Protected function GetUrl: string; virtual; abstract;
Protected procedure SetMethod(AValue: string); virtual; abstract;
Protected procedure SetUrl(AValue: string); virtual; abstract;
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 PutForm(const AUrl: string; AFormData, AResponse: TStream): Boolean; virtual; abstract;
Public class function PutForm(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

Protected procedure SetContentType(AValue: string); virtual; abstract;
 
Protected function GetContentType: string; virtual; abstract;
 
Protected function GetClient: TObject; virtual; abstract;
 
Protected function GetContents: TStrings; virtual; abstract;
 
Protected function GetCookies: TStrings; virtual; abstract;
 
Protected function GetDocument: TStream; virtual; abstract;
 
Protected function GetHeaders: TStrings; virtual; abstract;
 
Protected function GetReasonPhrase: string; virtual; abstract;
 
Protected function GetStatusCode: Integer; virtual; abstract;
 
Protected function GetMethod: string; virtual; abstract;
 
Protected function GetUrl: string; virtual; abstract;
 
Protected procedure SetMethod(AValue: string); virtual; abstract;
 
Protected procedure SetUrl(AValue: string); virtual; abstract;
 
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 PutForm(const AUrl: string; AFormData, AResponse: TStream): Boolean; virtual; abstract;

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

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

Sends request by a PUT 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.


Generated by PasDoc 0.15.0.