Unit HTTP

From Ultibo.org
Jump to: navigation, search

Return to Unit Reference


Description


Ultibo HTTP Interface unit

Constants



[Expand]
HTTP specific constants HTTP_*


[Expand]
HTTP date HTTP_DATE_*


[Expand]
HTTP client HTTP_*


[Expand]
HTTP server HTTP_SERVER_*


[Expand]
HTTP protocol HTTP_PROTOCOL_*


[Expand]
HTTP method HTTP_METHOD_*


[Expand]
HTTP version HTTP_VERSION_*


[Expand]
HTTP encoding HTTP_ENCODING_*


[Expand]
HTTP general header HTTP_GENERAL_HEADER_*


[Expand]
HTTP request header HTTP_REQUEST_HEADER_*


[Expand]
HTTP response header HTTP_RESPONSE_HEADER_*


[Expand]
HTTP entity header HTTP_ENTITY_HEADER_*


[Expand]
HTTP status HTTP_STATUS_*


[Expand]
HTTP reason HTTP_REASON_*


[Expand]
HTTP content type HTTP_CONTENT_*


[Expand]
HTTP cache control HTTP_CACHE_*


[Expand]
HTTP connection HTTP_CONNECTION_*


[Expand]
HTTP request flag HTTP_REQUEST_FLAG_*


[Expand]
HTTP response flag HTTP_RESPONSE_FLAG_*


[Expand]
HTTP client state HTTP_CLIENT_STATE_*


[Expand]
HTTP host flag HTTP_HOST_FLAG_*


[Expand]
HTTP CGI flag HTTP_CGI_FLAG_*


[Expand]
HTTP error flag HTTP_ERROR_FLAG_*


[Expand]
HTTP module flag HTTP_MODULE_FLAG_*


[Expand]
HTTP document flag HTTP_DOCUMENT_FLAG_*


[Expand]
HTTP mime type HTTP_MIME_TYPE_*


[Expand]
HTTP logging HTTP_LOG_LEVEL_*


Type definitions



HTTP reserved chars

THTTPReservedChars = set of AnsiChar;

HTTP redirect event

THTTPRedirectEvent = function(AClient:THTTPClient; const AURL:String; var ALocation:String):Boolean of Object;

HTTP password event

THTTPPasswordEvent = function(AClient:THTTPClient; var AUsername,APassword:String):Boolean of Object;

HTTP host event

THTTPHostEvent = function(AHost:THTTPHost; ARequest:THTTPServerRequest; AResponse:THTTPServerResponse):Boolean of Object;

HTTP error event

THTTPErrorEvent = function(AHost:THTTPHost; AError:THTTPError; ARequest:THTTPServerRequest; AResponse:THTTPServerResponse):Boolean of Object;

HTTP module event

THTTPModuleEvent = function(AHost:THTTPHost; AModule:THTTPModule; ARequest:THTTPServerRequest; AResponse:THTTPServerResponse):Boolean of Object;

HTTP document event

THTTPDocumentEvent = function(AHost:THTTPHost; ADocument:THTTPDocument; ARequest:THTTPServerRequest; AResponse:THTTPServerResponse):Boolean of Object;


Class definitions



HTTP helper classes

THTTPBuffer = class(TObject)

HTTP common classes

THTTPParam = class(TListObject)
THTTPParams = class(TObject)
THTTPHeader = class(TListObject)
THTTPHeaders = class(TObject)

HTTP client classes

THTTPClientRequest = class(TObject)
THTTPClientResponse = class(TObject)
THTTPClient = class(TWinsock2TCPClient)

HTTP server classes

THTTPServerRequest = class(TObject)
THTTPServerResponse = class(TObject)
THTTPHost = class(TListObject)
THTTPError = class(TListObject)
THTTPAlias = class(TListObject)
THTTPModule = class(TListObject)
THTTPDocument = class(TListObject)
THTTPMimeType = class(TListObject)
THTTPRedirect = class(THTTPDocument)
THTTPFolder = class(THTTPDocument)
THTTPFile = class(THTTPDocument)
THTTPListener = class(TWinsock2TCPListener)


Public variables



HTTP logging

HTTP_DEFAULT_LOG_LEVEL:LongWord = HTTP_LOG_LEVEL_DEBUG; Minimum level for HTTP messages. Only messages with level greater than or equal to this will be printed.
HTTP_LOG_ENABLED:Boolean;


Function declarations



Initialization functions

[Expand]
procedure HTTPInit;
Description: To be documented


HTTP helper functions

[Expand]
function HTTPEncode(const AValue:String; AReserved:THTTPReservedChars):String;
Description: To be documented


[Expand]
function HTTPDecode(const AValue:String; AQuery:Boolean = False):String;
Description: To be documented


[Expand]
function HTTPParseURI(const AURI:String; var AProtocol,AHost,APort,APath,AQuery:String):Boolean;
Description: To be documented


[Expand]
function HTTPBuildURI(const AProtocol,AHost,APort,APath,AQuery:String; var AURI:String):Boolean;
Description: To be documented


[Expand]
function HTTPParseHost(const AHost:String; var AName,APort:String):Boolean;
Description: To be documented


[Expand]
function HTTPBuildHost(const AName,APort:String; var AHost:String):Boolean;
Description: To be documented


[Expand]
function HTTPParseParam(const AParam:String; var AName,AValue:String):Boolean;
Description: To be documented


[Expand]
function HTTPBuildParam(const AName,AValue:String; var AParam:String):Boolean;
Description: To be documented


[Expand]
function HTTPParseQuery(const AQuery:String; AParams:THTTPParams):Boolean;
Description: To be documented


[Expand]
function HTTPBuildQuery(AParams:THTTPParams; var AQuery:String):Boolean;
Description: To be documented


[Expand]
function HTTPParseHeader(const AHeader:String; var AName,AValue:String):Boolean;
Description: To be documented


[Expand]
function HTTPBuildHeader(const AName,AValue:String; var AHeader:String):Boolean;
Description: To be documented


[Expand]
function HTTPPathExtractName(const ASource:String; var AName:String):Boolean;
Description: To be documented


[Expand]
function HTTPPathExtractDir(const ASource:String; var APath:String):Boolean;
Description: To be documented


[Expand]
function HTTPPathExtractPath(const ASource:String; var APath:String):Boolean;
Description: To be documented


[Expand]
function HTTPPathExtractExtension(const ASource:String; var AExtension:String):Boolean;
Description: To be documented


[Expand]
function HTTPParseRequestLine(const ARequest:String; var AMethod:LongWord; var AURL:String; var AVersion:LongWord):Boolean;
Description: To be documented


[Expand]
function HTTPBuildRequestLine(AMethod:LongWord; const AURL:String; AVersion:LongWord; var ARequest:String):Boolean;
Description: To be documented


[Expand]
function HTTPParseResponseLine(const AResponse:String; var AVersion,AStatus:LongWord; var AReason:String):Boolean;
Description: To be documented


[Expand]
function HTTPBuildResponseLine(AVersion,AStatus:LongWord; const AReason:String; var AResponse:String):Boolean;
Description: To be documented


[Expand]
function FileTimeToHTTPDate(const AFileTime:TFileTime):String;
Description: To be documented


[Expand]
function HTTPDateToFileTime(const AHTTPDate:String):TFileTime;
Description: To be documented


[Expand]
function DateTimeToHTTPDate(const ADateTime:TDateTime):String;
Description: To be documented


[Expand]
function HTTPDateToDateTime(const AHTTPDate:String):TDateTime;
Description: To be documented


[Expand]
function StringToHTTPProtocol(const AProtocol:String):LongWord;
Description: To be documented


[Expand]
function HTTPProtocolToString(AProtocol:LongWord):String;
Description: To be documented


[Expand]
function StringToHTTPMethod(const AMethod:String):LongWord;
Description: To be documented


[Expand]
function HTTPMethodToString(AMethod:LongWord):String;
Description: To be documented


[Expand]
function StringToHTTPVersion(const AVersion:String):LongWord;
Description: To be documented


[Expand]
function HTTPVersionToString(AVersion:LongWord):String;
Description: To be documented


[Expand]
function StringToHTTPEncoding(const AEncoding:String):LongWord;
Description: To be documented


[Expand]
function HTTPEncodingToString(AEncoding:LongWord):String;
Description: To be documented


[Expand]
function StringToHTTPStatus(const AStatus:String):LongWord;
Description: To be documented


[Expand]
function HTTPStatusToString(AStatus:LongWord):String;
Description: To be documented


[Expand]
procedure HTTPLog(Level:LongWord;const AText:String);
Description: To be documented


[Expand]
procedure HTTPLogInfo(const AText:String); inline;
Description: To be documented


[Expand]
procedure HTTPLogWarn(const AText:String); inline;
Description: To be documented


[Expand]
procedure HTTPLogError(const AText:String); inline;
Description: To be documented


[Expand]
procedure HTTPLogDebug(const AText:String); inline;
Description: To be documented


Return to Unit Reference