Classe THTTPSend
Unit
httpsend
Declaração
type THTTPSend = class(TSynaClient)
Descrição
abstract(Implementation of HTTP protocol.)
Hierarquia
Visão Geral
Campos
Métodos
Propriedades
Descrição
Campos
 |
FAliveHost: string; |
|
 |
FAlivePort: string; |
|
 |
FHeaders: TStringList; |
|
 |
FMimeType: string; |
|
 |
FProtocol: string; |
|
 |
FKeepAlive: Boolean; |
|
 |
FKeepAliveTimeout: integer; |
|
 |
FStatus100: Boolean; |
|
 |
FProxyHost: string; |
|
 |
FProxyPort: string; |
|
 |
FProxyUser: string; |
|
 |
FProxyPass: string; |
|
 |
FResultCode: Integer; |
|
 |
FResultString: string; |
|
 |
FUserAgent: string; |
|
 |
FCookies: TStringList; |
|
 |
FDownloadSize: int64; |
|
 |
FUploadSize: int64; |
|
 |
FRangeStart: int64; |
|
 |
FRangeEnd: int64; |
|
 |
FAddPortNumberToHost: Boolean; |
|
Métodos
 |
function ReadUnknown: Boolean; virtual; |
|
 |
function ReadIdentity(Size: int64): Boolean; virtual; |
|
 |
function ReadChunked: Boolean; virtual; |
|
 |
procedure ParseCookies; |
|
 |
function PrepareHeaders: AnsiString; |
|
 |
function InternalDoConnect(needssl: Boolean): Boolean; |
|
 |
function InternalConnect(needssl: Boolean): Boolean; |
|
 |
constructor Create; |
|
 |
destructor Destroy; override; |
|
 |
function HTTPMethod(const Method, URL: string): Boolean; |
Connects to host defined in URL and accesses resource defined in URL by method. If Document is not empty, send it to the server as part of the HTTP request. Server response is in Document and headers. Connection may be authorised by username and password in URL. If you define proxy properties, connection is made by this proxy. If all OK, result is True , else result is False .
If you use 'https:' instead of 'http:' in the URL, your request is made by SSL/TLS connection (if you do not specify port, then port 443 is used instead of standard port 80). If you use SSL/TLS request and you have defined HTTP proxy, then HTTP-tunnel mode is automatically used .
|
 |
procedure Abort; |
You can call this method from OnStatus event to break current data transfer. (or from another thread.)
|
Propriedades
 |
property Headers: TStringList read FHeaders; |
Before HTTP operation you may define any non-standard headers for HTTP request, except: 'Expect: 100-continue', 'Content-Length', 'Content-Type', 'Connection', 'Authorization', 'Proxy-Authorization' and 'Host' headers . After HTTP operation, it contains full headers of the returned document.
|
 |
property Cookies: TStringList read FCookies; |
Stringlist with name-value stringlist pairs. Each pair is one cookie. After the HTTP request is returned, cookies are parsed to this stringlist. You can leave these cookies untouched for next HTTP requests. You can also save this stringlist for later use.
|
 |
property Document: TMemoryStream read FDocument; |
Stream with document to send (before request), or with document received from HTTP server (after request).
|
 |
property RangeStart: int64 read FRangeStart Write FRangeStart; |
If you need to download only part of a requested document, specify here the position of subpart begin. If 0, the full document is requested.
|
 |
property RangeEnd: int64 read FRangeEnd Write FRangeEnd; |
If you need to download only part of a requested document, specify here the position of subpart end. If 0, the document from rangeStart to end of document is requested. (Useful for resuming broken downloads, for example.)
|
 |
property MimeType: string read FMimeType Write FMimeType; |
Mime type of sending data. Default is: 'text/html'.
|
 |
property Protocol: string read FProtocol Write FProtocol; |
Define protocol version. Possible values are: '1.1', '1.0' (default) and '0.9'.
|
 |
property Status100: Boolean read FStatus100 Write FStatus100; |
if True , then the server is requested for 100status capability when uploading data. Default is False (off).
|
 |
property ProxyHost: string read FProxyHost Write FProxyHost; |
Address of proxy server (IP address or domain name) where you want to connect in HTTPMethod method.
|
 |
property ProxyPort: string read FProxyPort Write FProxyPort; |
Port number for proxy connection. Default value is 8080.
|
 |
property UserAgent: string read FUserAgent Write FUserAgent; |
Here you can specify custom User-Agent identification. Default: 'Mozilla/4.0 (compatible; Synapse)'
|
 |
property DownloadSize: int64 read FDownloadSize; |
if this value is not 0, then data download is pending. In this case you have here the total size of downloaded data. Useful for drawing download progressbar from OnStatus event.
|
 |
property UploadSize: int64 read FUploadSize; |
if this value is not 0, then data upload is pending. In this case you have here the total size of uploaded data. Useful for drawing upload progressbar from OnStatus event.
|
 |
property Sock: TTCPBlockSocket read FSock; |
Socket object used for TCP/IP operation. Good for setting OnStatus hook, etc.
|
 |
property AddPortNumberToHost: Boolean read FAddPortNumberToHost write FAddPortNumberToHost; |
Allows to switch off port number in 'Host:' HTTP header. By default True . Some buggy servers do not like port informations in this header.
|
Gerado por PasDoc 0.16.0.