NAME
curlformget - serialize a previously build multipart/formdata HTTP
POST chainSYNOPSIS
##iinncclluuddee <
> vvooiidd ccuurrllffoorrmmggeett((ssttrruucctt ccuurrllhhttttppppoosstt **form, vvooiidd **arg, ccuurrllffoorr-
mmggeettccaallllbbaacckk append));;DESCRIPTION
curlformget() is used to serialize data previously built/appended with curlformadd(3). Accepts a void pointer as second argument which will be passed to the curlformgetcallback function. ttyyppeeddeeff ssiizzeett ((**ccuurrllffoorrmmggeettccaallllbbaacckk))((vvooiidd **arg, ccoonnsstt cchhaarr **buf, ssiizzeett len));; The curlformgetcallback will be executed for each part of the HTTP POST chain. The void *arg pointer will be the one passed as second argument to curlformget(). The character buffer passed to it must not be freed. The callback should return the buffer length passed to it on success. RREETTUURRNN VVAALLUUEE0 means everything was ok, non-zero means an error occurred
EEXXAAMMPPLLEE sizet printhttppostcallback(void *arg, const char *buf, sizet len) { fwrite(buf, len, 1, stdout); (*(sizet *) arg) += len; return len; } sizet printhttppost(struct curlhttppost *post) { sizet totalsize = 0; if(curlformget(post, &totalsize, printhttppostcallback)) {return (sizet) -1;
} return totalsize; } AVAILABILITY This function was added in libcurl 7.15.5SEE ALSO
ccuurrllffoorrmmaadddd(3) libcurl 7.15.5 20 June 2006 curlformget(3)