Repository navigation
Home
The guiding principle of LibQurl is to abstract away most of the lifetime management minutiae that the average AHKv2 user would find frustrating about libcurl.
However, abstracted does not mean absent. There are an immense number of ways to productively use libcurl for network transactions. The supplied defaults are therefore intended to be sane without becoming restrictive.
As you read the documentation, keep in mind that almost everything in libcurl runs off of some variety of handle. While you won't see many in the examples, it can be assumed that any "handleless" call uses an internally-supplied default handle when the final parameter is unset. The API Reference at the bottom of the sidebar contains the full signature of every implemented method if you're ever in doubt.
See Getting Started for installation, SSL backend selection, and full setup.
This is the minimum viable transfer:
curl := LibQurl()
curl.SetOpt("URL", "https://httpbin.org/get")
curl.Sync()
body := curl.GetLastBody()Explanation
-
LibQurl()loads the DLL, initializes libcurl, probes and selects the SSL backend (WolfSSL default), creates the initial easy_handle, sets sensible defaults (compression, redirects, error buffer, cert bundle), and soft-prepares the Magic download target. -
SetOpt("URL", ...)stores the value in the handle's options record and callscurl_easy_setoptunder the hood to set libcurl's network destination. -
Sync()initializes the Magic storage destination, then callscurl_easy_perform. libcurl handles DNS, TCP, TLS, the HTTP request, and the response write. On completion,ClearPostis invoked automatically. -
GetLastBody()retrieves the stored body from the handle map, detects whether it landed as aBufferor aFile, and returns it as a UTF-8 string.
- Full direct binding of libcurl. All known functions accessible.
- The vast majority of functionality wrapped with sensible defaults.
- Numerous simultaneous handles. Multi (Async) interface supported. All options remembered per-handle.
- Compressed transfers on by default.
- Download directly into RAM without touching disk.
- A unique "magic" hybrid mode: starts in memory, flushes to disk at a size threshold.
- Effortless POSTing from String, Integer, Object, Array, Map, Buffer, or FileObject.
- Effortless MIME form building with the same smart source handling.
- Manual WebSocket traffic and protocol-level raw data.
- Full Aris support. Recommended install method.
- Foundations — installation, terminology, error model
- Operations — step-by-step guides grounded in working test cases
- API Reference — per-handle method reference with signatures and return values
- Code Snippets — excerpts taken from real projects using the library
Foundations
Operations
- Download Modes
- Setting and Listing Options
- Setting and Inspecting Headers
- POST and Upload
- Multiple Easy Handles
- Async and Multi Interface
- URL Construction
- Share Interface
- MIME and Multipart
- Raw Send and Receive
- Pause and Resume
- WebSocket
- SSL Sessions
- Debug and Diagnostics
API Reference
- Easy Handle Reference
- Multi Handle Reference
- Share Handle Reference
- MIME Handle Reference
- URL Handle Reference
- Utility Methods Reference
- WebSocket Reference
Code Snippets