SYNAPSE - Synchronous TCP/IP Library for Delphi
Other related information can be found at http://www.ararat.cz/synapse/
Class: THTTPSend
- Properties:
- Timeout:integer
Define timeout in milliseconds for all HTTP operations. Default value is 300 seconds.
- HTTPhost:String
Address of HTTP server (IP address or domain name) where you want to connect.
- HTTPPort:string
Port number for HTTP connection. Default value is 80.
- ProxyHost:String
Address of proxy server (IP address or domain name) where you want to connect in DoMethod method.
- ProxyPort:string
Port number for proxy connection. Default value is 8080.
- ProxyUser:String
Username for connect to proxy server where you want to connect in DoMethod method.
- ProxyPass:String
Password for connect to proxy server where you want to connect in DoMethod method.
- ResultCode:integer
After successful HTTPMethod method contains result code of operation.
- ResultString:integer
After successful HTTPMethod method contains string after result code.
- KeepAlive:boolean
If true (default value), keppalives in HTTP protocol 1.1 is enabled.
- Protocol:string
Define protocol version. Possible values are: '1.1' (default), '1.0' and '0.9'.
- MimeType:string
Mime type of sending data. Default is: 'text/html'.
- headers:TStringlist
After HTTP operation contains full document headers. 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.
- Document:TMemoryStream
Stream with document to send (before request, or with document received from HTTP server (after request).
- Methods:
- procedure Clear
Reset headers and document and Mimetype.
- Function HTTPmethod(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 byt 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.
- Not class (but cohere) functions:
- Function HttpGetText(URL:string;Response:TStrings):Boolean
This is useful function and example of use THTTPSend object. It implement GET method of HTTP protocol. This function send GET metod for URL document at HTTP server. Returned document is in Response stringlist (without any headers). If all OK, result is true, else result is false.
- Function HttpGetBinary(URL:string;Response:TStream):Boolean
This is useful function and example of use THTTPSend object. It implement GET method of HTTP protocol. This function send GET metod for URL document at HTTP server. Returned document is in Response stream. If all OK, result is true, else result is false.
- Function HttpPostBinary(URL:string;Data:TStream):Boolean
This is useful function and example of use THTTPSend object. It implement SEND method of HTTP protocol. This function send SEND metod for URL document at HTTP server. Sending document is in Data stream. Returned document is in data stream. If all OK, result is true, else result is false.