On Tue, 4 Apr 2017, Reese Grimsley wrote:

curl_formadd(&formPost, &last,
CURLFORM_COPYNAME, "metadata",
CURLFORM_COPYCONTENTS, jpost,
CURLFORM_CONTENTLEN, 0,
CURLFORM_CONTENTTYPE, "application/json",
CURLFORM_END);

Your CURLFORM_CONTENTLEN value 0 is not a curl_off_t type so libcurl gets that and the rest of your arguments totally garbled. Since you pass in a string to CURLFORM_COPYCONTENTS anyway you don't need to set CURLFORM_CONTENTLEN anyway.

I assume the CURLFORM_COPYNAME is for changing the name just after the content disposition header, and that charset will be modified automatically, since I can't tell a way to do this explicitly.

libcurl will set the exact name as the name of the field, it does not set charset in any way.

--

 / daniel.haxx.se
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html

Reply via email to