I added curl_easy_setopt(client, CURLOPT_ENCODING, \"gzip\");
to my code.
I expected curl to cause the server to send compressed data AND to decompress it
c++ CURL library does not compress/decompress your data. you must do it yourself.
CURL *curl = curl_easy_init();
struct curl_slist *headers=NULL;
headers = curl_slist_append(headers, "Accept: application/json");
headers = curl_slist_append(headers, "Content-Type: application/json");
headers = curl_slist_append(headers, "Content-Encoding: gzip");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers );
curl_easy_setopt(curl, CURLOPT_ENCODING, "gzip");
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, zipped_data.data() );
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, zipped_data.size() );