This is a full libcurl wrap for AHKv2.
Much work has been done to abstract away the need for a full understanding of curl's rather arcane architecture, while still allowing complete access to those inner workings when required.
- This is a full direct binding of libcurl, meaning that you have access* to all functions.
- libcurl's "easy" interface is completely wrapped in a user-friendly way.
- Seamless async transfers are possible if desired.
- Transparently compressed transfers are on by default - this saves bandwidth and time.
- Numerous simultaneous curl handles are supported, as is the multi interface. All options are remembered per-handle.
- The ability to download a file directly into RAM without touching the disk - very useful when working with APIs.
- Effortless POSTing of data from almost any source, be it a String, Integer, Object, Array, Map, Buffer, or even a FileObject.
- Similarly effortless building of complex MIME forms, with the same smart source handling.
- You can manually send and receive protocol-level raw data.
- Full support for Descolada's fantastic AHK package manager, Aris. (This is the recommended installation method!)
*Around 25 dll functions were added in an "untested" state and are clearly marked as such. Among these, there are almost certainly some instances of providing the wrong data type in the DllCall. Caveat emptor until checked off on the function list below. Most common functions are already properly wrapped.
- Establish basic communication with the DLL
- Wrap Easy
- Wrap Multi
- Wrap Multi_Socket
- Wrap misc functions that weren't required by any of the above
- Externally unify the Easy, Multi, and Multi_Socket calls (if possible!)
- add handling for Opts with scaffolding during the batch SetOpts
- gather and clean the SetOpts after a handle finishes downloading
- build the read/progress/debug callbacks
- write an "output to null" callback function for more safely reseting file writes (currently resets to memory output)
- create callback that reads POSTed file incrementally (currently read entirely into memory before uploading)
- add the other origin types to GetAllHeaders
- implement libmagic instead of file.exe
Implemented Functions
https://curl.se/libcurl/c/allfuncs.htmlWrapped? | Name | Notes |
---|---|---|
✓ | curl_easy_cleanup | |
✓ | curl_easy_duphandle | |
✓ | curl_easy_getinfo | |
✓ | curl_easy_header | |
✓ | curl_easy_init | |
✓ | curl_easy_nextheader | |
✓ | curl_easy_option_by_id | |
✓ | curl_easy_option_by_name | |
✓ | curl_easy_option_next | |
✓ | curl_easy_pause | |
✓ | curl_easy_perform | called with .Sync() |
✓ | curl_easy_recv | |
✓ | curl_easy_reset | |
✓ | curl_easy_send | |
✓ | curl_easy_setopt | |
✓ | curl_easy_strerror | |
✓ | curl_easy_upkeep | |
✓ | curl_free | |
✓ | curl_getdate | |
curl_global_cleanup | ||
✓ | curl_global_init | only default mode for now |
curl_global_init_mem | ||
✓ | curl_global_sslset | |
✓ | curl_mime_addpart | |
✓ | curl_mime_data | |
curl_mime_data_cb | ||
✓ | curl_mime_encoder | |
✓ | curl_mime_filedata | |
✓ | curl_mime_filename | |
✓ | curl_mime_free | |
✓ | curl_mime_headers | |
✓ | curl_mime_init | |
✓ | curl_mime_name | |
✓ | curl_mime_subparts | |
✓ | curl_mime_type | |
✓ | curl_multi_add_handle | called with .ReadySync() |
curl_multi_assign | ||
✓ | curl_multi_cleanup | |
curl_multi_fdset | ||
✓ | curl_multi_info_read | |
✓ | curl_multi_init | |
✓ | curl_multi_perform | called with .Async() |
✓ | curl_multi_remove_handle | |
✓ | curl_multi_setopt | |
curl_multi_socket_action | ||
✓ | curl_multi_strerror | |
curl_multi_timeout | ||
curl_multi_poll | ||
curl_multi_wait | ||
curl_multi_wakeup | ||
curl_pushheader_byname | ||
curl_pushheader_bynum | ||
✓ | curl_share_cleanup | |
✓ | curl_share_init | |
✓ | curl_share_setopt | |
✓ | curl_share_strerror | |
✓ | curl_slist_append | |
✓ | curl_slist_free_all | |
✓ | curl_url | |
✓ | curl_url_cleanup | |
✓ | curl_url_dup | |
✓ | curl_url_get | |
✓ | curl_url_set | |
✓ | curl_url_strerror | |
✓ | curl_version | |
✓ | curl_version_info | |
curl_ws_recv | ||
curl_ws_send | ||
curl_ws_meta |
Deprecated Functions with Suggested Alternatives
Wrapped? | Name | Alternative |
---|---|---|
❌ | curl_easy_escape curl_easy_unescape curl_escape curl_unescape |
use the URL API |
❌ | curl_formadd curl_formfree curl_formget |
use the mime API |