A little libcURL binding for Delphi XE2+. Supports “easy” interface only. See wiki for more documentation.
Clone or download
Latest commit 1427f4c Nov 3, 2017
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Examples “Tokyo” is out, check it now! Nov 3, 2017
Src CurlDllName Nov 3, 2017
php_curl License. Oct 27, 2017
.gitignore Tested under Win64 Mar 22, 2015
readme.md v0.3_Tokyo_doc Nov 3, 2017

readme.md

About curl4delphi

curl4delphi is a simple Delphi XE2+ binding for libcURL.

© 2015–2017 Mikhail Merkuryev

My initial version supports “easy” interface only.

Note from developer

Version 0.3 “Tokyo” is out! It is much easier than 0.2.

Check it now, though you can face some incompatibilities with older versions. But I think they are easy to overcome, nothing was changed radically.

Quick start

  1. Add files Curl.Lib, Curl.Easy, Curl.Interfaces to your project.
  2. Write such a piece of code.
var
  curl : ICurl;

curl := CurlGet;
curl.SetUrl('http://example.com')
    .SetProxyFromIe
    .SetUserAgent(ChromeUserAgent)
    .SwitchRecvToString
    .Perform;
Writeln(curl.ResponseBody);

[To use streams for receiving, check EasyHttp\StreamedDl].

Examples

Misc\Version

Shows version

RawHttp\Readme

Basic HTTP GET, same as written above.

RawHttp\Simple, EasyHttp\Simple

Redirection, basic HTTP GET, GetInfo

RawHttp\Https, EasyHttp\Https

Redirection, basic HTTPS support, CA files, Unicode in file names.

Warning: download a CA file such as cacert.pem.

EasyHttp\StreamedDl

Downloading to Delphi TStream’s.

EasyHttp\FileDownloader

A GUI file downloader. This example is rather complex because of multithreading and Content-Disposition. We do as most browsers do: request headers, then start writing to temporary file and simultaneously ask where to save it on HDD.

Inter-thread communication, transfer function, quick-and-dirty header parsing.

RawHttp\AplusB_Post, EasyHttp\AplusB_Post

A simple form demo. Please copy php_curl directory to a PHP-capable web server.

Forms (one field is set in a simple way, the other in more complex one).

EasyHttp\PhotoInfo

File uploading: disk file (2 ways), memory buffer, stream.

ICurl cloning demo (not particularly good, it is more an illustration that Clone works).

Please copy php_curl directory to a PHP-capable web server.

EasyHttp\AplusB_Get

Using ICurlGetBuilder to build a GET URL. Please copy php_curl directory to a PHP-capable web server.

License

MIT for library, public domain for examples.