summaryrefslogtreecommitdiff
path: root/docs/libcurl/curl_formget.3
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2006-06-24 21:46:41 +0000
committerDaniel Stenberg <daniel@haxx.se>2006-06-24 21:46:41 +0000
commit37f4877e569cdd0d1afa6bb0d7cd3a463ee75ac9 (patch)
tree92346fb5f8cdc2114f5df2ece56a1544aef380dc /docs/libcurl/curl_formget.3
parenta6fc45c02f75467a171f55e5154047c86c0ed85e (diff)
downloadcurl-37f4877e569cdd0d1afa6bb0d7cd3a463ee75ac9.tar.gz
Michael Wallner added curl_formget(), which allows an application to extract
(serialise) a previously built formpost (as with curl_formadd()).
Diffstat (limited to 'docs/libcurl/curl_formget.3')
-rw-r--r--docs/libcurl/curl_formget.349
1 files changed, 49 insertions, 0 deletions
diff --git a/docs/libcurl/curl_formget.3 b/docs/libcurl/curl_formget.3
new file mode 100644
index 000000000..b0aad3670
--- /dev/null
+++ b/docs/libcurl/curl_formget.3
@@ -0,0 +1,49 @@
+.\" You can view this file with:
+.\" nroff -man [file]
+.\" $Id$
+.\"
+.TH curl_formget 3 "20 June 2006" "libcurl 7.15.5" "libcurl Manual"
+.SH NAME
+curl_formget - serialize a previously build multipart/formdata HTTP POST chain
+.SH SYNOPSIS
+.B #include <curl/curl.h>
+.sp
+.BI "void curl_formget(struct curl_httppost *" form, " void *" arg,
+.BI " curl_formget_callback " append);
+.ad
+.SH DESCRIPTION
+curl_formget() is used to serialize data previously built/appended with
+\fIcurl_formadd(3)\fP. Accepts a void pointer as second argument which will be
+passed to the curl_formget_callback function.
+
+.B "typedef size_t (*curl_formget_callback)(void *" arg, " const char *" buf,
+.B " size_t " len);
+.nf
+
+The curl_formget_callback will be executed for each part of the httppost
+struct. The void *arg pointer will be the one passed as second argument to
+curl_formget(). The character buffer passed to it must not be freed. The
+callback should return the buffer length passed to it on success.
+.SH RETURN VALUE
+0 means everything was ok, non-zero means an error occurred
+.SH EXAMPLE
+.nf
+
+ size_t print_httppost_callback(void *arg, const char *buf, size_t len)
+ {
+ fwrite(buf, len, 1, stdout);
+ (*(size_t *) arg) += len;
+ return len;
+ }
+ size_t print_httppost(struct curl_httppost *post)
+ {
+ size_t total_size = 0;
+ if(curl_formget(post, &total_size, out)) {
+ return (size_t) -1;
+ }
+ return total_size;
+ }
+.SH AVAILABILITY
+This function was added in libcurl 7.15.5
+.SH "SEE ALSO"
+.BR curl_formadd "(3) "