私はPostリクエストを行っています。そのために、ヘッダーのコンテンツタイプを設定する必要がapplication/json
あります。次のコードを書いています:
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, "charsets: utf-8");
res = curl_easy_setopt(curl, CURLOPT_HEADER,headers);
しかし、プログラムをコンパイルすると、エラーが次のように発生します
Accept: */*
Proxy-Connection: Keep-Alive
Content-Length: 22
Content-Type: application/x-www-form-urlencoded
application/json
できるだけ早くこのコンテンツ タイプを設定するのを手伝ってください