# Class THTTPSend

Description | Hierarchy | Fields | Methods | Properties

## Unit

httpsend

## Declaration

`type THTTPSend = class(TSynaClient)`

## Description

abstract(Implementation of HTTP protocol.)

## Hierarchy

THTTPSend > TSynaClient > TObject

## Methods

### Overview

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

### Description

| `procedure Abort;`

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

| `procedure Clear;`

Reset headers and document and Mimetype.

| `constructor Create;`

| `procedure DecodeStatus(const Value: string);`

Decode ResultCode and ResultString from Value.

| `destructor Destroy; override;`

| `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

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

### Description

| `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.

| `property Document: TMemoryStream;`

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

| `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.

| `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.

| `property KeepAlive: Boolean;`

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

| `property MimeType: string;`

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

| `property Protocol: string;`

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

| `property ProxyHost: string;`

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

| `property ProxyPass: string;`

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

| `property ProxyPort: string;`

Port number for proxy connection. Default value is 8080.

| `property ProxyUser: string;`

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

| `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.)

| `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.

| `property ResultCode: Integer;`

After successful HTTPMethod method contains result code of operation.

| `property ResultString: string;`

After successful HTTPMethod method contains string after result code.

| `property Sock: TTCPBlockSocket;`

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

| `property Status100: Boolean;`

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

| `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.

| `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