且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用libcurl使https获取

更新时间:2022-04-03 05:15:09

就像我在上面的评论中所写的那样:
我刚刚意识到自己做了:curl_slist_append(headers, header);
代替:headers = curl_slist_append(headers, header);
所以标头始终为NULL,我没有标头就发出了get请求.
(我在上面的问题中对其进行了编辑,因此该代码可以运行,如果有的话)

Like I wrote in the comment above:
I just realized that I made: curl_slist_append(headers, header);
instead of: headers = curl_slist_append(headers, header);
So headers was always NULL and I made the get request without a header.
(I edited it in my question above, so the code works, if some)