Repository navigation
Multiple Easy Handles
A single LibQurl() instance can manage any number of easy handles. Each handle maintains its own independent set of options, write targets, and transfer state.
Init() (or its alias EasyInit()) creates a new easy handle:
easy_handle_a := curl.Init()
easy_handle_b := curl.Init()The default handle (the first one created) is available without explicit creation. LibQurl() establishes it. You only need to call Init() when you want a second, third, or Nth handle.
Options, write targets, and transfer state are all scoped to the handle. Two handles pointing at different URLs with different settings do not interfere with each other:
easy_handle_a := curl.Init()
easy_handle_b := curl.Init()
curl.SetOpt("URL", "https://example.com/page1", easy_handle_a)
curl.SetOpt("URL", "https://example.com/page2", easy_handle_b)
curl.WriteToFile("C:\downloads\page1.html", easy_handle_a)
curl.WriteToFile("C:\downloads\page2.html", easy_handle_b)
curl.Sync(easy_handle_a)
curl.Sync(easy_handle_b)ListHandles returns a plaintext listing of all currently open easy handles:
MsgBox curl.ListHandles()DupeInit creates a new handle that is a logical clone of an existing one. All options are copied. Write and header callbacks are not — the new handle gets a fresh WriteToMem target internally.
Note: due to an unresolved technical issue the class manually rebuilds the easy_handle from the original stored options rather than invoking libcurl's native function. It should give identical results, however.
original := curl.Init()
curl.WriteToMem(, original)
curl.SetOpt("URL", "https://example.com/api", original)
curl.SetOpt("USERAGENT", "LibQurl/1.0", original)
; Clone the options onto a fresh handle
duped := curl.DupeInit()
; The duped handle has the same USERAGENT, the same URL, etc.
; But its write target is decoupled — it defaults to memory.
curl.SetOpt("URL", "https://example.com/api/v2", duped)
curl.Sync(original)
curl.Sync(duped)
bodyA := curl.GetLastBody(, original)
bodyB := curl.GetLastBody(, duped)Use DupeInit when you want a fresh handle pre-configured with the same options, without re-setting each one manually.
Cleanup (or its alias EasyCleanup) releases a handle and all its associated callbacks:
curl.EasyCleanup(easy_handle_a)If you clean up the last remaining easy handle, LibQurl automatically creates a fresh default so you are never left without one. See Terminology and Conventions.
- Async and Multi Interface — driving multiple handles concurrently
- Easy Handle Reference — full method list
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