0

我在 for 循环中有一个 curl 请求,如果它没有指定的字符串,我只想输出 curl 的结果

            curl_global_init(CURL_GLOBAL_ALL);
            curl = curl_easy_init();
            if(curl) {
              curl_easy_setopt(curl, CURLOPT_URL, "LOCALHOST:8080/questions.php");
              snprintf(postdata, sizeof postdata, "1=%s&2=%s&3=%s&4=%s&5=%s",
                 list[a],list[b],list[c],list[d],list[e]);
              curl_easy_setopt(curl, CURLOPT_POSTFIELDS, postdata);
              res = curl_easy_perform(curl);
              if(res != CURLE_OK)
                fprintf(stderr, "curl_easy_perform() failed: %s\n",
                        curl_easy_strerror(res));
              curl_easy_cleanup(curl);
            }
4

0 回答 0