]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
CURLOPT_POSTFIELDS.3: clarify how it gets the size of the data
authorDaniel Stenberg <daniel@haxx.se>
Fri, 23 Apr 2021 15:14:58 +0000 (17:14 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 23 Apr 2021 21:20:31 +0000 (23:20 +0200)
Ref: https://curl.se/mail/lib-2021-04/0085.html
Closes #6943

docs/libcurl/opts/CURLOPT_POSTFIELDS.3

index abbb81b3f4c9107801d5ae71b76784b45e116ba1..fff9ae9028f54add35d8fd55d9300c06e3be925f 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -52,6 +52,11 @@ the POST data from the read callback. If you want to send a zero-byte POST set
 \fICURLOPT_POSTFIELDS(3)\fP to an empty string, or set \fICURLOPT_POST(3)\fP to
 1 and \fICURLOPT_POSTFIELDSIZE(3)\fP to 0.
 
+libcurl will use assume this option points to a nul-terminated string unless
+you also set \fICURLOPT_POSTFIELDSIZE(3)\fP to specify the length of the
+provided data, which then is strictly required if you want to send off nul
+bytes included in the data.
+
 Using POST with HTTP 1.1 implies the use of a "Expect: 100-continue" header,
 and libcurl will add that header automatically if the POST is either known to
 be larger than 1MB or if the expected size is unknown. You can disable this