Class THTTPSend

DescriptionHierarchyFieldsMethodsProperties

Unit

httpsend

Declaration

type THTTPSend = class(TSynaClient)

Description

abstract(Implementation of HTTP protocol.)

Hierarchy

THTTPSend > TSynaClient > TObject

Methods

Overview

Public constructor Create;
Public destructor Destroy; override;
Public procedure Abort;
Public procedure Clear;
Public procedure DecodeStatus(const Value: string);
Public function HTTPMethod(const Method, URL: string): Boolean;

Description

Public procedure Abort;

You can call this method from OnStatus event for break current data transfer. (or from another thread.)

Public procedure Clear;

Reset headers and document and Mimetype.

Public constructor Create;

 

Public procedure DecodeStatus(const Value: string);

Decode ResultCode and ResultString from Value.

Public destructor Destroy; override;

 

Public function HTTPMethod(const Method, URL: string): Boolean;

Connects to host define in URL and access to resource defined in URL by method. If Document is not empty, send it to server as part of 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 in URL 'https:' instead only 'http:', then your request is made by SSL/TLS connection (if you not specify port, then port 443 is used instead standard port 80). If you use SSL/TLS request and you have defined HTTP proxy, then HTTP-tunnel mode is automaticly used .

Properties

Overview

Published property Cookies: TStringList;
Published property Document: TMemoryStream;
Published property DownloadSize: integer;
Published property Headers: TStringList;
Published property KeepAlive: Boolean;
Published property MimeType: string;
Published property Protocol: string;
Published property ProxyHost: string;
Published property ProxyPass: string;
Published property ProxyPort: string;
Published property ProxyUser: string;
Published property RangeEnd: integer;
Published property RangeStart: integer;
Published property ResultCode: Integer;
Published property ResultString: string;
Published property Sock: TTCPBlockSocket;
Published property Status100: Boolean;
Published property UploadSize: integer;
Published property UserAgent: string;

Description

Published property Cookies: TStringList;

This is stringlist with name-value stringlist pairs. Each this pair is one cookie. After HTTP request is returned cookies parsed to this stringlist. You can leave this cookies untouched for next HTTP request. You can also save this stringlist for later use.

Published property Document: TMemoryStream;

Stream with document to send (before request, or with document received from HTTP server (after request).

Published property DownloadSize: integer;

if this value is not 0, then data download pending. In this case you have here total sice of downloaded data. It is good for draw download progressbar from OnStatus event.

Published property Headers: TStringList;

Before HTTP operation you may define any non-standard headers for HTTP request, except of: 'Expect: 100-continue', 'Content-Length', 'Content-Type', 'Connection', 'Authorization', 'Proxy-Authorization' and 'Host' headers. After HTTP operation contains full headers of returned document.

Published property KeepAlive: Boolean;

If True (default value), keepalives in HTTP protocol 1.1 is enabled.

Published property MimeType: string;

Mime type of sending data. Default is: 'text/html'.

Published property Protocol: string;

Define protocol version. Possible values are: '1.1', '1.0' (default) and '0.9'.

Published property ProxyHost: string;

Address of proxy server (IP address or domain name) where you want to connect in HTTPMethod method.

Published property ProxyPass: string;

Password for connect to proxy server where you want to connect in HTTPMethod method.

Published property ProxyPort: string;

Port number for proxy connection. Default value is 8080.

Published property ProxyUser: string;

Username for connect to proxy server where you want to connect in HTTPMethod method.

Published property RangeEnd: integer;

If you need download only part of requested document, here specify possition of subpart end. If here 0, then is requested document from rangeStart to end of document. (for broken download restoration, for example.)

Published property RangeStart: integer;

If you need download only part of requested document, here specify possition of subpart begin. If here 0, then is requested full document.

Published property ResultCode: Integer;

After successful HTTPMethod method contains result code of operation.

Published property ResultString: string;

After successful HTTPMethod method contains string after result code.

Published property Sock: TTCPBlockSocket;

Socket object used for TCP/IP operation. Good for seting OnStatus hook, etc.

Published property Status100: Boolean;

if True, then server is requested for 100status capability when uploading data. Default is False (off).

Published property UploadSize: integer;

if this value is not 0, then data upload pending. In this case you have here total sice of uploaded data. It is good for draw upload progressbar from OnStatus event.

Published property UserAgent: string;

Here you can specify custom User-Agent indentification. By default is used: 'Mozilla/4.0 (compatible; Synapse)'


Generated by PasDoc 0.8.8.2 on 2005-01-19 20:01:18