Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Curl | 31,327 | 78 | 12 hours ago | 36 | June 16, 2023 | 61 | other | C | ||
A command line tool and library for transferring data with URL syntax, supporting DICT, FILE, FTP, FTPS, GOPHER, GOPHERS, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, MQTT, POP3, POP3S, RTMP, RTMPS, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET, TFTP, WS and WSS. libcurl offers a myriad of powerful features | ||||||||||
Mailkit | 5,562 | 485 | 981 | 10 days ago | 169 | June 17, 2023 | 6 | mit | C# | |
A cross-platform .NET library for IMAP, POP3, and SMTP. | ||||||||||
Mailu | 4,864 | 2 days ago | 146 | other | Python | |||||
Insular email distribution - mail server as Docker images | ||||||||||
Neomutt | 2,906 | 15 hours ago | 350 | gpl-2.0 | C | |||||
✉️ Teaching an Old Dog New Tricks -- IRC: #neomutt on irc.libera.chat | ||||||||||
Imapsync | 2,777 | 5 months ago | 121 | other | Perl | |||||
Imapsync is an IMAP transfers tool. The purpose of imapsync is to migrate IMAP accounts or to backup IMAP accounts. IMAP is one of the three current standard protocols to access mailboxes, the two others are POP3 and HTTP with webmails, webmails are often tied to an IMAP server. Upstream website is | ||||||||||
Mailcore2 | 2,450 | a year ago | 2 | March 24, 2015 | 191 | other | C++ | |||
MailCore 2 provide a simple and asynchronous API to work with e-mail protocols IMAP, POP and SMTP. The API has been redesigned from ground up. | ||||||||||
Magma | 1,812 | 4 days ago | 46 | agpl-3.0 | C | |||||
The magma server daemon, is an encrypted email system with support for SMTP, POP, IMAP, HTTP and MOLTEN,. Additional support for DMTP and DMAP is currently in active development. | ||||||||||
Php Imap | 1,516 | 138 | 30 | 10 months ago | 65 | December 05, 2022 | 38 | mit | PHP | |
Manage mailboxes, filter/get/delete emails in PHP (supports IMAP/POP3/NNTP) | ||||||||||
Fapro | 1,374 | 8 months ago | 7 | Python | ||||||
Fake Protocol Server | ||||||||||
Cypht | 844 | 12 hours ago | 127 | lgpl-2.1 | PHP | |||||
Cypht: Lightweight Open Source webmail written in PHP and JavaScript |
It is delphi and object pascal bindings and wrapper around cURL library. libcurl is the library is using for transferring data specified with URL syntax, supporting HTTP, HTTPS, FTP, FTPS, GOPHER, TFTP, SCP, SFTP, SMB, TELNET, DICT, LDAP, LDAPS, FILE, IMAP, SMTP, POP3, RTSP and RTMP.
Library is tested for
Get the sources and add the source directory to the project search path. For FPC add the source directory to the fpc.cfg file.
Clone the repository git clone https://github.com/isemenkov/libpascurl
.
Add the unit you want to use to the uses
clause.
libpascurl.pas file contains the cURL translated headers to use this library in pascal programs. You can find C API documentation at cURL website.
uses
libpascurl;
var
handle : CURL;
effectiveUrl, contentType, ip : PChar;
responseCode, headerSize : Longint;
contentLength, totalTime : Longword;
buffer : TStringStream;
function WriteFunctionCallback (ptr : PChar; size : LongWord;
nmemb : LongWord; data : Pointer)
begin
buffer.WriteString(string(ptr));
end;
begin
curl_global_init(CURL_GLOBAL_ALL);
curl_easy_setopt(handle, CURLOPT_URL, PChar('https://example.dev');
curl_easy_setopt(handle, CURLOPT_WRITEFUNCTION, @WriteFunctionCallback);
buffer := TStringStream.Create('');
if curl_easy_perform = CURLE_OK then
begin
New(effectiveUrl);
New(contentType);
New(ip);
curl_easy_getinfo(handle, CURLINFO_EFFECTIVE_URL, @effectiveUrl);
curl_easy_getinfo(handle, CURLINFO_RESPONSE_CODE, @responseCode);
curl_easy_getinfo(handle, CURLINFO_HEADER_SIZE, @headerSize);
curl_easy_getinfo(handle, CURLINFO_CONTENT_TYPE, @contentType);
curl_easy_getinfo(handle, CURLINFO_CONTENT_LENGTH_DOWNLOAD_T, @contentLength);
curl_easy_getinfo(handle, CURLINFO_LOCAL_IP, @ip);
curl_easy_getinfo(handle, CURLINFO_TOTAL_TIME_T, @totalTime);
writeln('URL: ':20, effectiveUrl);
writeln('Response code: ':20, responseCode);
writeln('Header size, kB: ':20, FormatFloat('0.00', headerSize / 1024));
writeln('Content type: ', contentType);
writeln('Content length, kB: ':20, FormatFloat('0.00', contentLength / 1024));
writeln('IP: ':20, ip);
writeln('Total time, ms: ':20, totalTime);
writeln('==== Content ====');
writeln(buffer.DataString);
end;
curl_global_cleanup;
end;
The library contains a set of classes for creating high-level wrappers around the supported protocols. The source/curl/
folder contains base components that implements specific functionality.
Class | Description |
---|---|
TCURLEasy | It is base class that initialize CURL library and provides error handling functionality. |
TSession | It is parent class for sessions of all supported protocols. It provides a TMemoryBuffer for stored downloading/uploading data. |
TResponse | It is parent class for server response data. |
TPropertyModule | It is base class for all sessions and responses additional functionality modules. |
Module class | Description |
---|---|
TModuleDNS | Class provide properties to setup libCurl DNS options. |
TModuleRequest | Class provide properties to setup request properties and callbacks. |
TModuleHeader | Class provide properties to setup headers. Can be used only with HTTP-like protocols - HTTP(S), FTP(S), POP3(S), IMAP, SMTP. |
TModuleOptions | Class provide properties to setup different libCurl internal options. |
TModuleProtocols | Class provide properties to setup libCurl protocol options. |
TModuleSocket | Class provide properties to socket setup. |
TModuleTCP | Class provide properties to setup TCP protocol options. |
TModuleWriter | Class provide properties to setup download callback function. |
TModuleReader | Class provide properties to setup upload callback function. |
TModuleAuth | Class provide properties to setup auth options. |
TModuleTLSAuth | Class provide properties to setup TLS auth authentication options. |
TModuleProxy | Class provide properties to setup proxy options. |
TModuleSock5 | Class provide properties to setup sock5 proxy options. |
Module class | Description |
---|---|
TModuleContent | Class provide properties to get content data buffer. |
TModuleHeader | Class provide properties to response headers. Can be used only with HTTP-like protocols - HTTP(S), FTP(S), POP3(S), IMAP, SMTP. |
TModuleRedirect | Class provide information about request redirects. |
TModuleSpeed | Class provide speed download/upload information. |
TModuleTimeout | Class provide timeouts information. |
TModuleInfo | Class provide session information. |
THTTPSession and THTTPResponse classes implements wrapper about HTTP(S) protocol. This classes extends the functionality of base classes and provided new one that is specific only to this protocol.
This wrapper used or extends the next main modules: Session modules | Response modules ----------------|:----------------- ✔️ TModuleDNS | ✔️ TModuleContent ✔️ TModuleHeader | ✔️ TModuleHeader ✔️ TModuleOptions | ✔️ TModuleRedirect ✔️ TModuleProtocols | ✔️ TModuleSpeed ✔️ TModuleSocket | ✔️ TModuleTimeout ✔️ TModuleTCP | ✔️ TModuleInfo ✔️ TModuleWriter | ✔️ TModuleReader | ✔️ TModuleRequest | ✔️ TModuleAuth | ✔️ TModuleTLSAuth | ✔️ TModuleProxy | ✔️ TModuleSock5 |
Module class | Description |
---|---|
TModuleRedirect | Class provide properties to setup http(s) redirect options. |
TModuleHTTP2 | Class provide properties to setup HTTP/2 protocol options. |
TModuleTimeout | Class provide properties to setup http(s) protocol timeouts options. |
Module class | Description |
---|---|
TModuleCookie | Class provide cookies data. |
uses
curl.http.session, curl.http.response;
var
Session : THTTP.TSession;
Response : THHTP.TResponse;
begin
Session.Url := 'https://github.com/isemenkov';
Session.Redirect.FollowRedirect := True;
Response := Session.Get;
writeln('Url', Response.Request.Url);
writeln('Response code', Response.Header.ResponseCode);
writeln('Content-type', Response.Content.ContentType);
writeln('Content-size', Response.Content.ContentSize);
writeln('Content', Response.Content.ToString);
end;