diff options
author | Daniel Stenberg <daniel@haxx.se> | 2014-10-21 08:58:03 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2014-10-21 08:58:24 +0200 |
commit | c857bb68ec37f82b62238fca73942e6ede8bd8f7 (patch) | |
tree | 084c1ff2355e2b3ce77c8a69bec4657a78cbfcc2 /docs/libcurl/opts/CURLOPT_POSTFIELDSIZE.3 | |
parent | 005f2adaaa8025849760b30289e06916ea25f548 (diff) | |
download | curl-c857bb68ec37f82b62238fca73942e6ede8bd8f7.tar.gz |
opts: added examples
Diffstat (limited to 'docs/libcurl/opts/CURLOPT_POSTFIELDSIZE.3')
-rw-r--r-- | docs/libcurl/opts/CURLOPT_POSTFIELDSIZE.3 | 16 |
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 |