真好,有 C++库真的超方便
#include <iostream>
#include <string>
#include "curl/curl.h"
using namespace std;
int main()
{
system("chcp 65001");//很多时候,中文乱码,加上就行了
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "http://www.anyuer.club");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Postman-Token: 8924a699-16d7-4ca8-b6a2-cd28a3c68221");
curl_easy_setopt(hnd, CURLOPT_HEADER, 1);//显示响应头
CURLcode ret = curl_easy_perform(hnd);
while (1);
return 0;
}
没有截图,因为我懒得截图
发表评论: