From f014eeceb218200c5864ce91a8de2cc21d951c32 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 23 Apr 2021 17:14:58 +0200 Subject: [PATCH] CURLOPT_POSTFIELDS.3: clarify how it gets the size of the data Ref: https://curl.se/mail/lib-2021-04/0085.html Closes #6943 --- docs/libcurl/opts/CURLOPT_POSTFIELDS.3 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 -- 2.47.3