cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: documentation update

From: bch <brad.harder_at_gmail.com>
Date: Tue, 18 Nov 2014 12:00:51 -0800

On 11/18/14, Dan Fandrich <dan_at_coneharvesters.com> wrote:
> On Tue, Nov 18, 2014 at 10:57:57AM -0800, bch wrote:
>> Inspired by one of Daniels recent podcasts. Note that I did *NOT*
>
> Thanks for sending in a patch!
>
>> patch the .html, because it looks like it's generated by a roff-tool
>> of Daniels.
>
> Correct; the web version is built from the troff source in git.
>
>>
>> Regards,
>>
>> -bch
>>
>> Index: src/vendor/curl/docs/libcurl/opts/CURLOPT_POSTFIELDS.3
>> ==================================================================
>> --- src/vendor/curl/docs/libcurl/opts/CURLOPT_POSTFIELDS.3
>> +++ src/vendor/curl/docs/libcurl/opts/CURLOPT_POSTFIELDS.3
>> @@ -31,11 +31,11 @@
>> Pass a char * as parameter, pointing to the full data to send in a HTTP
>> POST
>> operation. You must make sure that the data is formatted the way you want
>> the
>> server to receive it. libcurl will not convert or encode it for you in
>> any
>> way. For example, the web server may assume that this data is
>> url-encoded.
>>
>> -The data pointed to is NOT copied by the library: as a consequence, it
>> must be
>> +By default, the data pointed to is NOT copied by the library: as a
>> consequence, it must be
>> preserved by the calling application until the associated transfer
>> finishes.
>
> I'm not sure I agree with this change. Adding "By default" implies that
> there
> are some conditions under which the data IS copied by the library, but there
> aren't. CURLOPT_POSTFIELDS never copies its data.

If I understand correctly, there is a condition -- if you've set the
CURLOPT_COPYPOSTFIELDS. If you set this the data is copied -- it's
necessary to set it explicitly (hence my note "By default" -- which I
meant to mean "This is the typical behaviour, but there are conditions
where this doesn't happen" (COPYPOSTFIELDS).

It's not even clear to me that "by default" is enough -- I don't know
if a user of this function would browse all the SEE ALSO links.
Perhaps the "by default" should be more explicit. I'm also open to
being wrong about the "by default", but I'm not convinced I'm wrong,
yet :)

>>
>> This POST is a normal application/x-www-form-urlencoded kind (and libcurl
>> will
>> set that Content-Type by default when this option is used), which is
>> commonly
>> used by HTML forms. Change Content-Type with \fICURLOPT_HTTPHEADER(3)\fP.
>> @@ -77,6 +77,6 @@
>> .SH AVAILABILITY
>> Always
>> .SH RETURN VALUE
>> Returns CURLE_OK
>> .SH "SEE ALSO"
>> -.BR CURLOPT_POSTFIELDSIZE "(3), " CURLOPT_READFUNCTION "(3), "
>> +.BR CURLOPT_POSTFIELDSIZE "(3), " CURLOPT_READFUNCTION "(3), "
>> CURLOPT_COPYPOSTFIELDS "(3)"
>
> That one makes good sense.
>
>>>> Dan
> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/list/listinfo/curl-library
> Etiquette: http://curl.haxx.se/mail/etiquette.html
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2014-11-18