Post a file with data streaming

This commit is contained in:
Chunting Gu
2019-08-12 14:06:59 +08:00
parent 2e655efdc1
commit 4f9263048f
10 changed files with 266 additions and 209 deletions
+7 -10
View File
@@ -6,18 +6,15 @@
#include "webcc/client_session.h"
#include "webcc/logger.h"
void Help(const char* argv0) {
std::cout << "Usage: file_downloader <url> <path>" << std::endl;
std::cout << "E.g.," << std::endl;
std::cout << " file_downloader http://httpbin.org/image/jpeg D:/test.jpg"
<< std::endl;
std::cout << " file_downloader https://www.google.com/favicon.ico"
<< " D:/test.ico" << std::endl;
}
int main(int argc, char* argv[]) {
if (argc != 3) {
Help(argv[0]);
std::cout << "usage: file_downloader <url> <path>" << std::endl;
std::cout << std::endl;
std::cout << "examples:" << std::endl;
std::cout << " $ file_downloader http://httpbin.org/image/jpeg D:/test.jpg"
<< std::endl;
std::cout << " $ file_downloader https://www.google.com/favicon.ico"
<< " D:/test.ico" << std::endl;
return 1;
}