編譯libcurl

參考:http://blog.csdn.net/yannanxiu/article/details/56841726
1.libcurl的應用舉例:

#include <stdio.h>  
#include <curl.h>    

#pragma comment(lib,"libcurld.lib")  

int main(int argc, char* argv[])

{

    CURL *curl;
    CURLcode res;

    curl = curl_easy_init();

    if (curl) {
        curl_easy_setopt(curl, CURLOPT_URL, "http://www.baidu.com");
        /* example.com is redirected, so we tell libcurl to follow redirection */
        curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);

        /* Perform the request, res will get the return code */
        res = curl_easy_perform(curl);
        /* Check for errors */
        if (res != CURLE_OK)
            fprintf(stderr, "curl_easy_perform() failed: %s\n",
                curl_easy_strerror(res));
        system("pause");
        /* always cleanup */
        curl_easy_cleanup(curl);
    }
    return 0;
}
最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容

  • Android 自定義View的各種姿勢1 Activity的顯示之ViewRootImpl詳解 Activity...
    passiontim閱讀 173,335評論 25 708
  • 在此特此聲明:一下所有鏈接均來自互聯網,在此記錄下我的查閱學習歷程,感謝各位原創作者的無私奉獻 ! 技術一點一點積...
    遠航的移動開發歷程閱讀 11,222評論 12 197
  • 今天卓姐姐生日,想了一天都沒想好送什么禮物給她,想著晚上吃飯逛街的時候買點實用的東西。 銀泰城碰面,就我倆,吃了東...
    W大步溜閱讀 221評論 0 0