![]() Hierarchy Properties Methods Events |
![]() ![]() ![]() |
The acHTTP component is extremely easy to use WinInet-based HTTP client component which allows to post and get any data from the Web via HTTP protocol. With acHTTP you can grab Web pages, download files and documents (or only their headers without the content), get results of the CGI programs (for example, results of web-based search engines / databases), or even upload files to the Web-based programs.
|
|
The acHTTP can grab web contents both in binary and text formats, supports cache of Internet Explorer, can pause and resume broken downloads, read data from password protected directories and automatically supports several proxy authentication schemes (basic, digest, NTLM etc).
|
· | works with both, HTTP and HTTPS protocols + can read files from local area network using "file://" prefix for URLs;
|
· | can either POST or GET data to remote CGI programs;
|
· | can upload files by HTTP protocol, using multipart/form-data POST method, introduced in RFC 1867;
|
· | can download or upload data to password protected Web directories;
|
· | flexible cache control, provided by WinINet library. The acHTTP just use standard cache of Internet Explorer to retreive or write downloaded files to cache and save bandwidth from re-downloading. The cache control can be is easily customized by various options;
|
· | can pause and resume broken downloads;
|
· | automatically accepts SSL certificates, can allow or disallow access to sites with invalid or expired certificates;
|
· | can automatically retreive proxy information from Internet Options of Control Panel, make HTTP requests with custom proxy settins or directly without any proxy server;
|
· | automatically supports several secure proxy authentication schemes: basic, digest, NTLM (NT Lan Manager), MSN (Microsoft Network), DPA (Distributed Password Authentication) and RPA (Remote Passphrase Authentication by CompuServe)
|
· | using super stable threading mechanism, which allows to execute HTTP requests from both, standard, and ActiveX forms.
|
Just specify the location of Internet document which you would like to receive to URL property, and call Read method to start downloading. Use OnDone event to handle received data, or use OnHTTPError, OnConnLost and OnHostUnreachable events to handle errors. To show the download progress, write OnProgress event handler.
|
|
If you need to send some data to the CGI program via POST method, specify the request in the POSTData property before Reading. Usually acHTTP component can automatically recognize which request method you would like to use, POST or GET, however if you wish you can specify it in the RequestMethod property.
|
|
If you want to just check the HTTP headers of remote document without downloading it (or before downloading) write the OnHeaderInfo event handler to receive all the headers (document size, content type, language, encoding, last modification and expiration date and so forth). You can also use this event to check the file information and decide whether you really want to download it
|
|
To read files from password protected Web directories you should specify login information in Username and Password properties. Also use OnPasswordRequest event to specify login information dynamically.
|
|
![]() |
|
![]() |
|
If you need to terminate downloading process imediately call Abort method. In case if you downloading some binary data to file (specified in OutputFileName property), you can resume the downloading at any time using Resume method.
|
|
![]() |
|
In case if compared data are equal it continue downloading and append downloaded data to the end of local file. Otherwise it assume that file which beging downloaded has been changed, and starts download from beginning.
|
|
By default TransferBufferSize = 4Kb, so every time when you call Resume method, the component download 4Kb of extra "rollback" data to check file consistancy.
|
![]() |
In Delphi: http://www.appcontrols.com/demos/httpdemo-delphi.zip
|
In C++ Builder: http://www.appcontrols.com/demos/httpdemo-bcb.zip
|
Compiled executable: http://www.appcontrols.com/demos/exe/HTTPDemo.exe
|
![]() |
acHTTPDownloadQueue, acThread, acAutoUpgrader, acSendMail and acWebImage components.
|