基于libcurl 的http异步请求

上传者: hydirl | 上传时间: 2021-05-11 14:09:59 | 文件大小: 561KB | 文件类型: ZIP
最近工作关系,需要一个c++实现的异步http请求功能,在网上查了些质料,最后决定用libcurl。不过libcurl编译起来比较困难,研究了很长时间才弄明白。这个小程序只是简单的使用线程池实现了libcurl的异步请求功能,很多地方还需要优化,之所有厚颜上传到这里,主要有有三个目的。 一个是回报这些天在CSDN上得到的帮助,希望可以帮助到后来的人; 二是感于libcurl编译实在繁琐,如果有需要这个库又一时编译不通过的人,可以直接拿程序中的libcurl库文件用; 三是希望得到CSDN上大神们的指点。 如果要使用这个程序所设计的异步http请求功能,可以继承 HttpBaseRequest 类,重写virtual void OnComplete(CURLcode code);方法来处理应答消息。 如果有其他与本程序相关的问题

文件下载

资源详情

[{"title":"( 62 个子文件 561KB ) 基于libcurl 的http异步请求","children":[{"title":"Http","children":[{"title":".gitattributes <span style='color:#111;'> 2.52KB </span>","children":null,"spread":false},{"title":"Debug","children":null,"spread":false},{"title":"Http.sln <span style='color:#111;'> 1.26KB </span>","children":null,"spread":false},{"title":"Http","children":[{"title":"HttpDef.h <span style='color:#111;'> 6.82KB </span>","children":null,"spread":false},{"title":"Debug","children":null,"spread":false},{"title":"libcurl","children":[{"title":"curlbuild.h <span style='color:#111;'> 21.80KB </span>","children":null,"spread":false},{"title":"easy.h <span style='color:#111;'> 3.39KB </span>","children":null,"spread":false},{"title":"curlver.h <span style='color:#111;'> 2.68KB </span>","children":null,"spread":false},{"title":"lib","children":[{"title":"libcurl_a.lib <span style='color:#111;'> 1.57MB </span>","children":null,"spread":false}],"spread":true},{"title":"typecheck-gcc.h <span style='color:#111;'> 36.52KB </span>","children":null,"spread":false},{"title":"curl.h <span style='color:#111;'> 86.08KB </span>","children":null,"spread":false},{"title":"curlrules.h <span style='color:#111;'> 8.72KB </span>","children":null,"spread":false},{"title":"stdcheaders.h <span style='color:#111;'> 1.30KB </span>","children":null,"spread":false},{"title":"multi.h <span style='color:#111;'> 14.47KB </span>","children":null,"spread":false},{"title":"mprintf.h <span style='color:#111;'> 2.72KB </span>","children":null,"spread":false}],"spread":true},{"title":"Http.cpp <span style='color:#111;'> 389B </span>","children":null,"spread":false},{"title":"HttpManager.cpp <span style='color:#111;'> 3.02KB </span>","children":null,"spread":false},{"title":"HttpThreadPool.cpp <span style='color:#111;'> 603B </span>","children":null,"spread":false},{"title":"stdafx.h <span style='color:#111;'> 718B </span>","children":null,"spread":false},{"title":"ReadMe.txt <span style='color:#111;'> 1.45KB </span>","children":null,"spread":false},{"title":"HttpBaseRequest.h <span style='color:#111;'> 952B </span>","children":null,"spread":false},{"title":"Http.vcxproj.filters <span style='color:#111;'> 2.03KB </span>","children":null,"spread":false},{"title":"HttpManager.h <span style='color:#111;'> 248B </span>","children":null,"spread":false},{"title":"HttpBaseRequest.cpp <span style='color:#111;'> 2.16KB </span>","children":null,"spread":false},{"title":"stdafx.cpp <span style='color:#111;'> 208B </span>","children":null,"spread":false},{"title":"HttpThread.h <span style='color:#111;'> 398B </span>","children":null,"spread":false},{"title":"Http.vcxproj <span style='color:#111;'> 8.31KB </span>","children":null,"spread":false},{"title":"HttpThreadPool.h <span style='color:#111;'> 300B </span>","children":null,"spread":false},{"title":"targetver.h <span style='color:#111;'> 240B </span>","children":null,"spread":false},{"title":"HttpThread.cpp <span style='color:#111;'> 998B </span>","children":null,"spread":false}],"spread":false},{"title":".vs","children":[{"title":"Http","children":[{"title":"v14","children":[{"title":".suo <span style='color:#111;'> 60.00KB </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true},{"title":"Http.VC.VC.opendb <span style='color:#111;'> 28B </span>","children":null,"spread":false},{"title":".git","children":[{"title":"logs","children":[{"title":"HEAD <span style='color:#111;'> 327B </span>","children":null,"spread":false},{"title":"refs","children":[{"title":"heads","children":[{"title":"master <span style='color:#111;'> 327B </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true},{"title":"info","children":[{"title":"exclude <span style='color:#111;'> 113B </span>","children":null,"spread":false}],"spread":true},{"title":"index <span style='color:#111;'> 1.32KB </span>","children":null,"spread":false},{"title":"objects","children":[{"title":"aa","children":[{"title":"f8b251bddc2ee7ea2bc317110f1257bf82c19c <span style='color:#111;'> 234B </span>","children":null,"spread":false}],"spread":true},{"title":"pack","children":null,"spread":false},{"title":"b5","children":[{"title":"daaf5af3ce83ef491a57e22562578ffbb4689e <span style='color:#111;'> 119B </span>","children":null,"spread":false}],"spread":true},{"title":"02","children":[{"title":"794d4f224c1d41021d8afa660d97e01c5d35cc <span style='color:#111;'> 155B </span>","children":null,"spread":false}],"spread":false},{"title":"info","children":null,"spread":false},{"title":"93","children":[{"title":"eaa55277fce8b31367d2a1bf8e5f1fa11edbdf <span style='color:#111;'> 562B </span>","children":null,"spread":false}],"spread":false},{"title":"4c","children":[{"title":"813c6af4a77055696350f3e56e70292083def4 <span style='color:#111;'> 664B </span>","children":null,"spread":false}],"spread":false},{"title":"29","children":[{"title":"d07a3e98ac185c9f50b1a4557b106cb248aff6 <span style='color:#111;'> 250B </span>","children":null,"spread":false}],"spread":false},{"title":"3a","children":[{"title":"2238d6bfb9a40c1fdf8d76d3e53855b1d57118 <span style='color:#111;'> 1.84KB </span>","children":null,"spread":false}],"spread":false},{"title":"41","children":[{"title":"6cebf89fd0df8216693b65bba536a1436754e7 <span style='color:#111;'> 205B </span>","children":null,"spread":false}],"spread":false},{"title":"f7","children":[{"title":"09524cbee967f0296fc576c3e79b8c20061091 <span style='color:#111;'> 173B </span>","children":null,"spread":false}],"spread":false},{"title":"eb","children":[{"title":"642bcbc67fe014deb35e7abb73941556468e8c <span style='color:#111;'> 183B </span>","children":null,"spread":false}],"spread":false},{"title":"1f","children":[{"title":"f0c423042b46cb1d617b81efb715defbe8054d <span style='color:#111;'> 751B </span>","children":null,"spread":false}],"spread":false},{"title":"85","children":[{"title":"71deb6fe483fb5a860705dfab940e00838f146 <span style='color:#111;'> 437B </span>","children":null,"spread":false}],"spread":false},{"title":"0c","children":[{"title":"2e41fca702da07d1253cb3a1614a22fc5dd093 <span style='color:#111;'> 236B </span>","children":null,"spread":false}],"spread":false},{"title":"6b","children":[{"title":"f826fcdd225abc5c5b36e29256ac25635b9a1f <span style='color:#111;'> 152B </span>","children":null,"spread":false},{"title":"cb267e12e2bfadb6cdd41ba155764bb043ccc1 <span style='color:#111;'> 89B </span>","children":null,"spread":false}],"spread":false},{"title":"3d","children":[{"title":"05e695b6f9f2ccaee009edbe1fb5d2d97118c0 <span style='color:#111;'> 1.34KB </span>","children":null,"spread":false}],"spread":false},{"title":"92","children":[{"title":"edc5838885220186ff42651d18e27be29aa01b <span style='color:#111;'> 193B </span>","children":null,"spread":false},{"title":"a33ecbd63c2a60b1b1e1ff79c45192eb633a53 <span style='color:#111;'> 412B </span>","children":null,"spread":false}],"spread":false},{"title":"15","children":[{"title":"77c4e3bcb4044fc1878341fd4c5dc22157400e <span style='color:#111;'> 35B </span>","children":null,"spread":false}],"spread":false},{"title":"f6","children":[{"title":"e7a7727707aa0d5cc9744aa6f0aac5b9fcaea2 <span style='color:#111;'> 118B </span>","children":null,"spread":false}],"spread":false},{"title":"ea","children":[{"title":"d7faebf7da309aa7d7a8cc49d358222b9326fb <span style='color:#111;'> 437B </span>","children":null,"spread":false}],"spread":false}],"spread":false},{"title":"HEAD <span style='color:#111;'> 23B </span>","children":null,"spread":false},{"title":"config <span style='color:#111;'> 691B </span>","children":null,"spread":false},{"title":"ms-persist.xml <span style='color:#111;'> 150B </span>","children":null,"spread":false},{"title":"refs","children":[{"title":"heads","children":[{"title":"master <span style='color:#111;'> 41B </span>","children":null,"spread":false}],"spread":false},{"title":"tags","children":null,"spread":false}],"spread":true},{"title":"hooks","children":[{"title":"README.sample <span style='color:#111;'> 177B </span>","children":null,"spread":false}],"spread":false},{"title":"description <span style='color:#111;'> 73B </span>","children":null,"spread":false}],"spread":true},{"title":".gitignore <span style='color:#111;'> 3.98KB </span>","children":null,"spread":false}],"spread":true}],"spread":true}]

评论信息

  • xiao2macf :
    感谢分享,学习学习
    2020-12-24
  • hrt00011 :
    我想学习也行
    2019-09-09
  • zhui_m :
    看了大神写的案例 但是各种调用 渣渣表示搞不清。。
    2019-07-04
  • 小乌龟在大乌龟背上 :
    try againss
    2019-03-07
  • tanling_zero :
    学习一下!!
    2019-01-12
  • leo119 :
    来看看。学习一下
    2018-01-28
  • 啥时候能毕业啊 :
    就想看异步怎么处理response,结果直接打印了。。。
    2017-12-26
  • x6696 :
    来看看。学习一下
    2017-11-21
  • zeizeizhu :
    还是可以的,思路不错
    2017-10-31
  • 坑师傅 :
    感谢分享,学习学习。
    2017-09-10

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明