RealGas RealGas - 8 months ago 58
C++ Question

CURLOPT_POSTFIELDS sends data with strange encoding?

This is what I get

curl_easy_setopt(curl, CURLOPT_URL, "");
curl_easy_setopt(curl, CURLOPT_REFERER, "");
string data="abc";



CURLOPT_POSTFIELDS sends the data exactly as you pass to it, it doesn't translate, transcode or encode anything of it.

libcurl is a C API so you MUST provide the data as a plain char * and not a string. Use [string].c_str() or similar if you insist on using C++.