From: Daniel Stenberg Date: Fri, 23 Apr 2021 15:14:58 +0000 (+0200) Subject: CURLOPT_POSTFIELDS.3: clarify how it gets the size of the data X-Git-Tag: curl-7_77_0~136 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f014eeceb218200c5864ce91a8de2cc21d951c32;p=thirdparty%2Fcurl.git CURLOPT_POSTFIELDS.3: clarify how it gets the size of the data Ref: https://curl.se/mail/lib-2021-04/0085.html Closes #6943 --- diff --git a/docs/libcurl/opts/CURLOPT_POSTFIELDS.3 b/docs/libcurl/opts/CURLOPT_POSTFIELDS.3 index abbb81b3f4..fff9ae9028 100644 --- a/docs/libcurl/opts/CURLOPT_POSTFIELDS.3 +++ b/docs/libcurl/opts/CURLOPT_POSTFIELDS.3 @@ -5,7 +5,7 @@ .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * -.\" * Copyright (C) 1998 - 2020, Daniel Stenberg, , et al. +.\" * Copyright (C) 1998 - 2021, Daniel Stenberg, , 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