Libcurl:无法向requestbin发送自定义标头?

时间:2017-03-08 17:33:50

标签: c curl web-scraping http-headers libcurl

这是代码

#include <curl/curl.h>

int main(){
   CURL * curl;
   curl=curl_easy_init();
   struct curl_slist *headers=NULL;
   headers = curl_slist_append(headers, "Connection: keep-alive");
   headers = curl_slist_append(headers,"a : b");
   curl_easy_setopt(curl,CURLOPT_URL,"requestb.in/1ar78su1");
   curl_easy_setopt(curl,CURLOPT_HTTPHEADER,headers);
   curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
   curl_easy_perform(curl);
   curl_slist_free_all(headers);
  }

继承请求链接: 为什么它没有显示&#34; a:b&#34;和&#34;连接:保持活力&#34;在requestbin?

0 个答案:

没有答案