1. 客户端使用libcurl(C++) 测试用例
//http post测试用例-Begin
auto respCb = [=](const Json::Value json) {
cout << "\nUpload gif success by http : " << item._gif_name.c_str() << endl;
};
dev::httpPostGif("192.168.2.40:8080", "testgif.gif", g_appContext->cachePath, respCb);
return 0;
//http post测试用例-End
extern size_t writeCallback(void *buffer, size_t size, size_t nmemb, void *userp);
void httpPostGif(const std::string& url, const std::string& filename, const std::string& path, ResponseHandler cb) {
//发送超时时间
const int time = 5;
//超时重复发送次数
int times = 3;
//上传文件,指定本地文件完整路径
std::string imagePath = path.c_str();
imagePath.append(filename.c_str());
//打开图片文件
std::ifstream filestream(imagePath.c_str(),