#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, "{\r\n \"personA\": {\r\n \"gender\": \"男\",\r\n \"calendarType\": \"公历\",\r\n \"birthDate\": \"1990-12-01\",\r\n \"birthTime\": \"07:30:00\",\r\n \"language\": \"zh-CN\"\r\n },\r\n \"personB\": {\r\n \"gender\": \"女\",\r\n \"calendarType\": \"农历\",\r\n \"birthDate\": \"1992-05-15\",\r\n \"birthTime\": \"09:20:00\",\r\n \"isLeapMonth\": false,\r\n \"language\": \"zh-CN\"\r\n },\r\n \"focusAreas\": [\r\n \"沟通方式\",\r\n \"长期相处\"\r\n ],\r\n \"streaming\": false\r\n}");
CURLcode res = curl_easy_perform(curl);
(void)res;
curl_slist_free_all(headers);
curl_easy_cleanup(curl);
}
return 0;
}