#include <curl/curl.h>
int main(void) {
CURL *curl = curl_easy_init();
if (curl) {
curl_easy_setopt(curl, CURLOPT_URL, "https://api.gugudata.com/ai/bazi-relationship-insight?appkey=YOUR_APPKEY");
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Content-Type: application/json");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "{
\"personA\": {
\"gender\": \"男\",
\"calendarType\": \"公历\",
\"birthDate\": \"1990-12-01\",
\"birthTime\": \"07:30:00\",
\"language\": \"zh-CN\"
},
\"personB\": {
\"gender\": \"女\",
\"calendarType\": \"农历\",
\"birthDate\": \"1992-05-15\",
\"birthTime\": \"09:20:00\",
\"isLeapMonth\": false,
\"language\": \"zh-CN\"
},
\"focusAreas\": [
\"沟通方式\",
\"长期相处\"
],
\"streaming\": false
}");
CURLcode res = curl_easy_perform(curl);
(void)res;
curl_slist_free_all(headers);
curl_easy_cleanup(curl);
}
return 0;
}