10 Jul 2012 05:08
Need clarification on tutorial
Igor Korot <ikorot01 <at> gmail.com>
2012-07-10 03:08:15 GMT
2012-07-10 03:08:15 GMT
Hi, ALL, My name is Igor Korot and I'm starting to use CURL library as a developer. However I need some clarification since I'm not comprehending what is written in tutorial. I'm trying to read http://curl.haxx.se/libcurl/c/libcurl-tutorial.html, part "Uploading data to a Remote Site". Here is excerpt from it: " The read callback should have a prototype similar to: size_t function(char *bufptr, size_t size, size_t nitems, void *userp); Where bufptr is the pointer to a buffer we fill in with data to upload and size*nitems is the size of the buffer and therefore also the maximum amount of data we can return to libcurl in this call. The 'userp' pointer is the custom pointer we set to point to a struct of ours to pass private data between the application and the callback. curl_easy_setopt(easyhandle, CURLOPT_READFUNCTION, read_function); curl_easy_setopt(easyhandle, CURLOPT_READDATA, &filedata); Tell libcurl that we want to upload: curl_easy_setopt(easyhandle, CURLOPT_UPLOAD, 1L); "(Continue reading)
RSS Feed