日期:2014-05-16 浏览次数:20887 次
int main(int argc, char **argv)
{
// 初始化libcurl
CURLcode return_code;
return_code = curl_global_init(CURL_GLOBAL_ALL);
if (CURLE_OK != return_code)
{
cerr << "init libcurl failed." << endl;
return -1;
}
CURL *easy_handle = curl_easy_init();
if (NULL == easy_handle)
{
cerr << "get a easy handle failed." << endl;
curl_global_cleanup();
return -1;
}
curl_easy_setopt(easy_handle,CURLOPT_URL,"http://ceshi.com:8383/test.asp");
curl_easy_setopt(curl, CURLOPT_HTTPGET, "?test=string");
curl_easy_perform(easy_handle);
fclose(fp);
curl_easy_cleanup(easy_handle);
curl_global_cleanup();
return 0;
}