0

I have a curl request within a for loop and I would like to only output the result from the curl if it does not have a specified string`

            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);
            }
user2341069
  • 389
  • 5
  • 8
  • 14
  • What is your question? Assuming it is, "How do I check if a string contains a certain substring?" I'd link you to this question: http://stackoverflow.com/questions/15098936/simple-way-to-check-if-a-string-contains-another-string-in-c – Macattack Oct 27 '13 at 19:12
  • as far as i am aware the output comes from res = curl_easy_perform(curl); I don't know how to parse this – user2341069 Oct 27 '13 at 19:16

0 Answers0