1 Star 0 Fork 23

Ayrz/cxxurl

forked from xiaozhuai/cxxurl 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
example_download.cpp 715 Bytes
一键复制 编辑 原始数据 按行查看 历史
/**
* @author : xiaozhuai
* @date : 17/1/4
*/
#include <iostream>
#include <sstream>
#include <fstream>
#include <cxxurl/cxxurl_all.h>
using namespace std;
using namespace CXXUrl;
int main(int argc, char** argv){
ofstream downloadFile("./tao.png");
Request request = RequestBuilder()
.url("http://localhost:3000/download")
.followLocation(true)
.contentOutput(&downloadFile)
.build();
CURLcode res = request.get();
downloadFile.flush();
cout << "------------ Code ------------" << endl
<< res << endl
<< "----------- Content ----------" << endl
<< "Content has wrote to ./tao.png" << endl
<< flush;
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/ayrz2010/cxxurl.git
git@gitee.com:ayrz2010/cxxurl.git
ayrz2010
cxxurl
cxxurl
master

搜索帮助

D67c1975 1850385 1daf7b77 1850385