2 <title>curl_formget man page
</title>
3 <meta name=
"generator" content=
"roffit 0.7">
4 <STYLE type=
"text/css">
30 background-color: #e0e0e0;
36 font-family: monospace;
46 <p class=
"level0"><a name=
"NAME"></a><h2 class=
"nroffsh">NAME
</h2>
47 <p class=
"level0">curl_formget - serialize a previously build multipart/formdata HTTP POST chain
<a name=
"SYNOPSIS"></a><h2 class=
"nroffsh">SYNOPSIS
</h2>
48 <p class=
"level0"><span Class=
"bold">#include
<curl/curl.h
></span>
49 <p class=
"level0"><span Class=
"bold">void curl_formget(struct curl_httppost * form, void * arg,
</span> <span Class=
"bold"> curl_formget_callback append );
</span>
50 <p class=
"level0"><a name=
"DESCRIPTION"></a><h2 class=
"nroffsh">DESCRIPTION
</h2>
51 <p class=
"level0">curl_formget() is used to serialize data previously built/appended with
<a class=
"emphasis" href=
"./curl_formadd.html">curl_formadd(
3)
</a>. Accepts a void pointer as second argument which will be passed to the curl_formget_callback function.
52 <p class=
"level0"><span Class=
"bold">typedef size_t (*curl_formget_callback)(void * arg, const char * buf,
</span> <span Class=
"bold"> size_t len );
</span> <pre>
53 <p class=
"level0"><p class=
"level0">The curl_formget_callback will be executed for each part of the HTTP POST
54 chain. The void *arg pointer will be the one passed as second argument to
55 curl_formget(). The character buffer passed to it must not be freed. The
56 callback should return the buffer length passed to it on success.
58 <a name=
"RETURN"></a><h2 class=
"nroffsh">RETURN VALUE
</h2>
59 <p class=
"level0">0 means everything was ok, non-zero means an error occurred
<a name=
"EXAMPLE"></a><h2 class=
"nroffsh">EXAMPLE
</h2>
60 <p class=
"level0"><pre>
61 <p class=
"level0"><p class=
"level0"> size_t print_httppost_callback(void *arg, const char *buf, size_t len)
63 fwrite(buf, len,
1, stdout);
64 (*(size_t *) arg) += len;
67 size_t print_httppost(struct curl_httppost *post)
69 size_t total_size =
0;
70 if(curl_formget(post, &total_size, print_httppost_callback)) {
71 return (size_t) -
1;
73 return total_size;
76 <a name=
"AVAILABILITY"></a><h2 class=
"nroffsh">AVAILABILITY
</h2>
77 <p class=
"level0">This function was added in libcurl
7.15.5 <a name=
"SEE"></a><h2 class=
"nroffsh">SEE ALSO
</h2>
78 <p class=
"level0"><a class=
"manpage" href=
"./curl_formadd.html">curl_formadd (
3)
</a> <p class=
"roffit">
79 This HTML page was made with
<a href=
"http://daniel.haxx.se/projects/roffit/">roffit
</a>.