docs/examples: avoid deprecated options in examples where possible

Example programs targeting a deprecated feature/option are commented with
a warning about it.
Other examples are adapted to not use deprecated options.

Closes #9661
This commit is contained in:
Patrick Monnerat 2022-10-07 01:43:21 +02:00 committed by Daniel Stenberg
parent 28687ae271
commit 83de62babc
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
4 changed files with 40 additions and 46 deletions

View file

@ -26,6 +26,11 @@
* </DESC>
*/
/*
* Warning: this example uses the deprecated form api. See "multi-post.c"
* for a similar example using the mime api.
*/
#include <stdio.h>
#include <string.h>
#include <sys/time.h>
@ -49,14 +54,14 @@ int main(void)
curl_formadd(&formpost,
&lastptr,
CURLFORM_COPYNAME, "sendfile",
CURLFORM_FILE, "postit2.c",
CURLFORM_FILE, "multi-formadd.c",
CURLFORM_END);
/* Fill in the filename field */
curl_formadd(&formpost,
&lastptr,
CURLFORM_COPYNAME, "filename",
CURLFORM_COPYCONTENTS, "postit2.c",
CURLFORM_COPYCONTENTS, "multi-formadd.c",
CURLFORM_END);
/* Fill in the submit field too, even if this is rarely needed */