summaryrefslogtreecommitdiff
path: root/docs/libcurl/opts/CURLOPT_POSTFIELDSIZE.3
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2014-10-21 08:58:03 +0200
committerDaniel Stenberg <daniel@haxx.se>2014-10-21 08:58:24 +0200
commitc857bb68ec37f82b62238fca73942e6ede8bd8f7 (patch)
tree084c1ff2355e2b3ce77c8a69bec4657a78cbfcc2 /docs/libcurl/opts/CURLOPT_POSTFIELDSIZE.3
parent005f2adaaa8025849760b30289e06916ea25f548 (diff)
downloadcurl-c857bb68ec37f82b62238fca73942e6ede8bd8f7.tar.gz
opts: added examples
Diffstat (limited to 'docs/libcurl/opts/CURLOPT_POSTFIELDSIZE.3')
-rw-r--r--docs/libcurl/opts/CURLOPT_POSTFIELDSIZE.316
1 files changed, 15 insertions, 1 deletions
diff --git a/docs/libcurl/opts/CURLOPT_POSTFIELDSIZE.3 b/docs/libcurl/opts/CURLOPT_POSTFIELDSIZE.3
index 52be3f660..01668056e 100644
--- a/docs/libcurl/opts/CURLOPT_POSTFIELDSIZE.3
+++ b/docs/libcurl/opts/CURLOPT_POSTFIELDSIZE.3
@@ -39,7 +39,21 @@ If you post more than 2GB, use \fICURLOPT_POSTFIELDSIZE_LARGE(3)\fP.
.SH PROTOCOLS
HTTP
.SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+ const char *data = "data to send";
+
+ curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
+
+ /* size of the POST data */
+ curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, (long) strlen(data));
+
+ curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data);
+
+ curl_easy_perform(curl);
+}
+.fi
.SH AVAILABILITY
Along with HTTP
.SH RETURN VALUE