Unit BrookHttpUtils

Uses
Classes, Interfaces, Objects and Records
Constants
Variables

Description

HTTP utilities unit.

Overview

Functions and Procedures

function BrookDateTimeToGMT(const ADateTime: TDateTime): string;
function BrookSameUrl(AUrl1, AUrl2: string): Boolean;
function BrookStatusCodeToReasonPhrase(const AStatusCode: Word): string;
function BrookReasonPhraseToStatusCode(const AReasonPhrase: string): Word;
function BrookGetAcceptEncodingSet( const AAcceptEncoding: ShortString): TBrookAcceptEncodingSet;
function BrookGetAcceptEncoding( const AAcceptEncoding: TBrookAcceptEncodingSet): string;
function BrookMimeTypeFromFileExt(const AValue: string): string;
function BrookMimeTypeFromFileName(const AValue: string): string;
function BrookFileExtFromMimeType(const AValue: string): string;
function BrookExtractUrlFileName(const AUrl: string): string;
function BrookExtractUrlFileName(const AUrl: string; const AEscapeQueryString: Boolean): string;
function BrookRequestMethodToStr(const AMethod: TBrookRequestMethod): string;
function BrookStrToRequestMethod(const AMethod: string): TBrookRequestMethod;
function BrookHttpRequest(const AUrl: string; const AMethod: TBrookRequestMethod = rmGet; const AHttpClientLibrary: string = ES): TBrookHTTPResult;

Types

TBrookAcceptEncodingSet = set of (aeDeflate, aeGzip, aeSdch, aeXGzip);

Description

Functions and Procedures

function BrookDateTimeToGMT(const ADateTime: TDateTime): string;

Converts TDateTime to a GMT format.

function BrookSameUrl(AUrl1, AUrl2: string): Boolean;

Compare two URLs ignoring a possible final slash.

function BrookStatusCodeToReasonPhrase(const AStatusCode: Word): string;

Returns the reason phrase corresponding to a status code.

function BrookReasonPhraseToStatusCode(const AReasonPhrase: string): Word;

Returns the status code corresponding to a reason phrase.

function BrookGetAcceptEncodingSet( const AAcceptEncoding: ShortString): TBrookAcceptEncodingSet;

Returns a set of HTTP AceptEnconding header.

function BrookGetAcceptEncoding( const AAcceptEncoding: TBrookAcceptEncodingSet): string;

Returns a string of HTTP AcceptEnconding.

function BrookMimeTypeFromFileExt(const AValue: string): string;

Returns a MIME type by file extension.

function BrookMimeTypeFromFileName(const AValue: string): string;

Returns a MIME type by file name.

function BrookFileExtFromMimeType(const AValue: string): string;

Returns a file extension by MIME type.

function BrookExtractUrlFileName(const AUrl: string): string;

Extracts the file name of an URL.

function BrookExtractUrlFileName(const AUrl: string; const AEscapeQueryString: Boolean): string;

Extracts the file name of an URL and escapes it.

function BrookRequestMethodToStr(const AMethod: TBrookRequestMethod): string;

Returns the string corresponding to a TBrookRequestMethod.

function BrookStrToRequestMethod(const AMethod: string): TBrookRequestMethod;

Returns the TBrookRequestMethod corresponding to a string.

function BrookHttpRequest(const AUrl: string; const AMethod: TBrookRequestMethod = rmGet; const AHttpClientLibrary: string = ES): TBrookHTTPResult;

Perform HTTP requests. (allows all request methods)

Types

TBrookAcceptEncodingSet = set of (aeDeflate, aeGzip, aeSdch, aeXGzip);

Defines a set to represent the AcceptEncoding HTTP header.


Generated by PasDoc 0.15.0.