Skip to content

jakch78/RB-libcURL

 
 

Repository files navigation

##Introduction RB-libcURL is a libcURL binding for Realbasic and Xojo projects. It is designed and tested on Windows 7 against curl-7.40.0-devel-mingw32 and associated security and compression libraries (more platforms). The minimum supported libcURL version is 7.15.2.

##Hilights

##Synopsis


It is strongly recommended that you familiarize yourself with libcURL, as this project preserves the semantics of libcURL's API in an object-oriented, Xojo-flavored wrapper.

For a simplified client interface that is appropriate for most types of transfers you should use the cURLClient class. Refer to the examples below for demonstrations of cURLClient.


Each libcURL handle or handle equivalent is managed by an object class. These handle-managing classes all descend from a common ancestor, the abstract cURLHandle class.

libcURL uses several different handle types or equivalents:

Handle Type Object Class Comment
curl_easy EasyHandle A persistent collection of sockets, caches, and options which together will be used when libcURL is told to perform a transfer.
curl_multi MultiHandle A set of one or more curl_easy handles whose transfers will be performed simultaneously.
curl_share ShareHandle A set of one or more curl_easy handles that will share SSL session data, DNS caches, and/or HTTP cookies.
slist ListPtr A linked list of string values.
form MultipartForm An HTML form which libcURL encode as multipart/form-data.

Every transfer is associated with an EasyHandle. After creating a new EasyHandle instance, you can set various options for the handle by calling the SetOption method with the desired cURL option number and its new value.

Once all the desired options have been set (e.g. URL, port, cookies, etc.) you are ready to begin the transfer. Depending on your specific requirements, you can do it in one of several ways.

You may call EasyHandle.Perform directly. However, this is a blocking call; not merely asynchronous: the entire application halts for the duration of the transfer. As such, it is useful only in single-threaded console applications.

To perform one or more transfers in a non-halting manner use the MultiHandle class. The MultiHandle class represents a curl_multi handle (AKA a "stack"). Add the EasyHandle to the multi stack and then call MultiHandle.Perform (or MultiHandle.PerformOnce on a RB/Xojo thread.)

##Examples

Powered by libcURL

About

REALbasic and Xojo bindings for libcurl

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • REALbasic 100.0%