My C++ program currently invokes curl through a pipe (popen(\"curl ...\")) to POST a file of JSON data to a web server. This has obvious performance limitations due
popen(\"curl ...\")
Also, you may use RAW input instead of adding extra backslashes:
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, R"anydelim( {"hi" : "there"} )anydelim");
with delimiter or without it.