码迷,mamicode.com
首页 > 移动开发 > 详细

[curl] curl_slist_append

时间:2015-02-12 21:16:48      阅读:320      评论:0      收藏:0      [点我收藏+]

标签:

curl_slist_append

CURL *curl;
char host_header[256];
char vhost[256];
struct curl_slist *slist;

slist=0;
memset(host_header, 0, 256);
memset(vhost, 0, 256);

strncpy(vhost, "127.0.0.1", 9);
strncpy(host_header, "Host: ", 6);
strncat(host_header, vhost, 256-1-strlen(host_header));

slist = curl_slist_append(slist, host_header);
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, slist);

 

[curl] curl_slist_append

标签:

原文地址:http://www.cnblogs.com/dzxs/p/4288899.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!