libcurl-easy(3)
π NAME π
libcurl-easy(3) β easy interface overview. You're in the Library Functions Manual, bestie, and we're about to make libcurl's easy interface make sense. π
β¨ DESCRIPTION β¨
Okay so when you use libcurl's "easy" interface, you init your session and get a handle β usually called an "easy handle" β and that handle is what you use as input to the easy interface functions you use. To get the handle, call curl_easy_init(3). Slay. π«Ά
Then you continue by setting all the options you want in the upcoming transfer. The most important one is the URL itself β you literally cannot transfer anything without a specified URL. You might also want to set some callbacks as well, which are called from the library when data is available, etc. Example: CURLOPT_WRITEFUNCTION(3). curl_easy_setopt(3) is used for all this. β¨
CURLOPT_URL(3) is the only option you really must set, because otherwise there can be no transfer. Another commonly used option is CURLOPT_VERBOSE(3), which helps you see what libcurl is doing under the hood β useful when debugging, for example. The curl_easy_setopt(3) man page has a full index of the over 300 available options. Iconic. π
If at any point you would like to blank all previously set options for a single easy handle, you can call curl_easy_reset(3). You can also make a clone of an easy handle (with all its set options) using curl_easy_duphandle(3). Obsessed with a clean slate. π§
When all is setup, you tell libcurl to perform the transfer using curl_easy_perform(3). It performs the entire transfer operation and does not return until it is done β successfully or not. No cap. π
After the transfer has been made, you can set new options and make another transfer, or if you are done, cleanup the session by calling curl_easy_cleanup(3). If you want persistent connections, you do not cleanup immediately, but instead run ahead and perform other transfers using the same easy handle. Periodt. π
π SEE ALSO π
curl_easy_cleanup(3)curl_easy_init(3)curl_easy_setopt(3)libcurl(3)libcurl-errors(3)libcurl-multi(3)
mwah π β this page comes from libcurl, dated 2026-10-12, and its manual page name is libcurl-easy(3). π
π¦ where this page comes from
- fedora 44: libcurl-devel 8.18.0-14.fc44 Β· curl
- fedora 44: libcurl-devel 8.18.0-14.fc44 Β· curl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms