私はlibcurlを初めて使用しています。HTTP POST リクエストに使用する方法と結果を確認する方法が明確にわかりません。これをどのように使用できますか?
			
			10791 次
		
3 に答える
            14        
        
		
#include <curl/curl.h>
main()
{
  CURL *curl;
  curl_global_init(CURL_GLOBAL_ALL);
  curl = curl_easy_init();
  curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
  curl_easy_setopt(curl, CURLOPT_URL, "http://www.example.com/hello-world");
  curl_easy_setopt(curl, CURLOPT_POST, 1);
  curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "foo=bar&foz=baz");
  curl_easy_perform(curl);
  curl_easy_cleanup(curl);
}
    于 2012-05-18T10:36:57.923   に答える
    
    
            8        
        
		
Refer the manual page for documentation the -d option. You can use that multiple times to pass different key,value pairs to the server. Once that works, use the --libcurl flag to see what it would look like if you're trying to use libcurl to manually do this in your application.
于 2012-05-18T10:20:19.893   に答える