22 Star 67 Fork 23

xiaozhuai / cxxurl

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
example_get_https_enable.cpp 706 Bytes
一键复制 编辑 原始数据 按行查看 历史
/**
* @author : xiaozhuai
* @date : 17/1/4
*/
#include <iostream>
#include <sstream>
#include <cxxurl/cxxurl_all.h>
using namespace std;
using namespace CXXUrl;
int main(int argc, char** argv){
ostringstream contentOutput;
Request request = RequestBuilder()
.url("https://curl.haxx.se")
.followLocation(true)
.verifySSL(true)
.cacert("../cacert.pem")
.contentOutput(&contentOutput)
.build();
CURLcode res = request.get();
cout << "------------ Code ------------" << endl
<< res << endl
<< "----------- Content ----------" << endl
<< contentOutput.str() << endl
<< flush;
}
C++
1
https://gitee.com/xiaozhuai/cxxurl.git
git@gitee.com:xiaozhuai/cxxurl.git
xiaozhuai
cxxurl
cxxurl
master

搜索帮助