Implicit message type with curl_easy_perform, and how to CURLOPT_PUT/CURLOPT_UPLOAD?
Date: Wed, 10 Apr 2019 15:07:20 -0500
Here's what I'm observing.
1. I make a CURL instance with curl_easy_init
2. If there's postdata to send, I use
CURLOPT_POSTFIELDS/CURLOPT_POSTFIELDSIZE to set the post data.
If I skip step 2, it looks like curl_easy_init uses CURLOPT_HTTPGET. If
I do set CURLOPT_POSTFIELDS, curl_easy_init uses CURLOPT_HTTPPOST.
Is it also the case that if I use CURLOPT_READDATA and
CURLOPT_INFILESIZE to set put data, curl_easy_init will implicitly use
CURLOPT_UPLOAD? Or to I need to set CURLOPT_UPLOAD first?
So is there any way to send a character string with CURLOPT_UPLOAD,
besides writing the string to a temporary file and specifying
CURLOPT_READDATA to be an open FILE * for the temp file, and
CURLOPT_INFILESIZE to be the length of the string?