From 51d779256c74cc541da306db5629ed510df5a944 Mon Sep 17 00:00:00 2001 From: Toni Uhlig Date: Tue, 27 Apr 2021 13:45:54 +0200 Subject: Switched from slow blocking cpp-httplib to libevent2. Signed-off-by: Toni Uhlig --- deps/cpp-httplib/example/upload.cc | 61 -------------------------------------- 1 file changed, 61 deletions(-) delete mode 100644 deps/cpp-httplib/example/upload.cc (limited to 'deps/cpp-httplib/example/upload.cc') diff --git a/deps/cpp-httplib/example/upload.cc b/deps/cpp-httplib/example/upload.cc deleted file mode 100644 index 1e4f242..0000000 --- a/deps/cpp-httplib/example/upload.cc +++ /dev/null @@ -1,61 +0,0 @@ -// -// upload.cc -// -// Copyright (c) 2019 Yuji Hirose. All rights reserved. -// MIT License -// - -#include -#include -#include -using namespace httplib; -using namespace std; - -const char *html = R"( -
- - - -
- -)"; - -int main(void) { - Server svr; - - svr.Get("/", [](const Request & /*req*/, Response &res) { - res.set_content(html, "text/html"); - }); - - svr.Post("/post", [](const Request &req, Response &res) { - auto image_file = req.get_file_value("image_file"); - auto text_file = req.get_file_value("text_file"); - - cout << "image file length: " << image_file.content.length() << endl - << "image file name: " << image_file.filename << endl - << "text file length: " << text_file.content.length() << endl - << "text file name: " << text_file.filename << endl; - - { - ofstream ofs(image_file.filename, ios::binary); - ofs << image_file.content; - } - { - ofstream ofs(text_file.filename); - ofs << text_file.content; - } - - res.set_content("done", "text/plain"); - }); - - svr.listen("localhost", 1234); -} -- cgit v1.2.3