Rename form data examples.

master
Chunting Gu 6 years ago
parent 9b13dceab9
commit 9b31ac855a

@ -53,12 +53,6 @@ target_link_libraries(rest_book_server ${EXAMPLE_LIBS} jsoncpp)
add_executable(rest_book_client rest_book_client.cc ${REST_BOOK_SRCS}) add_executable(rest_book_client rest_book_client.cc ${REST_BOOK_SRCS})
target_link_libraries(rest_book_client ${EXAMPLE_LIBS} jsoncpp) target_link_libraries(rest_book_client ${EXAMPLE_LIBS} jsoncpp)
add_executable(file_upload_client file_upload_client.cc)
target_link_libraries(file_upload_client ${EXAMPLE_LIBS})
add_executable(file_upload_server file_upload_server.cc)
target_link_libraries(file_upload_server ${EXAMPLE_LIBS})
add_executable(file_server file_server.cc) add_executable(file_server file_server.cc)
target_link_libraries(file_server ${EXAMPLE_LIBS}) target_link_libraries(file_server ${EXAMPLE_LIBS})
@ -67,3 +61,9 @@ target_link_libraries(file_downloader ${EXAMPLE_LIBS})
add_executable(server_states server_states.cc) add_executable(server_states server_states.cc)
target_link_libraries(server_states ${EXAMPLE_LIBS}) target_link_libraries(server_states ${EXAMPLE_LIBS})
add_executable(form_client form_client.cc)
target_link_libraries(form_client ${EXAMPLE_LIBS})
add_executable(form_server form_server.cc)
target_link_libraries(form_server ${EXAMPLE_LIBS})

@ -1,3 +1,5 @@
// A client posting multipart form data.
#include <iostream> #include <iostream>
#include "boost/filesystem.hpp" #include "boost/filesystem.hpp"
@ -7,14 +9,13 @@
int main(int argc, char* argv[]) { int main(int argc, char* argv[]) {
if (argc < 2) { if (argc < 2) {
std::cout << "usage: file_upload_client <upload_dir> [url]" << std::endl; std::cout << "usage: form_client <upload_dir> [url]" << std::endl;
std::cout << std::endl; std::cout << std::endl;
std::cout << "default url: http://httpbin.org/post" << std::endl; std::cout << "default url: http://httpbin.org/post" << std::endl;
std::cout << std::endl; std::cout << std::endl;
std::cout << "examples:" << std::endl; std::cout << "examples:" << std::endl;
std::cout << " $ file_upload_client E:/github/webcc/data/upload" std::cout << " $ form_client E:/github/webcc/data/upload" << std::endl;
<< std::endl; std::cout << " $ form_client E:/github/webcc/data/upload "
std::cout << " $ file_upload_client E:/github/webcc/data/upload "
<< "http://httpbin.org/post" << std::endl; << "http://httpbin.org/post" << std::endl;
return 1; return 1;
} }

@ -1,3 +1,5 @@
// A server handling multipart form data.
#include <iostream> #include <iostream>
#include <string> #include <string>

@ -2,7 +2,7 @@
# http://flask.pocoo.org/docs/1.0/patterns/fileuploads/#uploading-files # http://flask.pocoo.org/docs/1.0/patterns/fileuploads/#uploading-files
# Run: # Run:
# (Windows) # (Windows)
# $ set FLASK_APP=file_upload_server.py # $ set FLASK_APP=form_server_flask.py
# $ flask # $ flask
import os import os
Loading…
Cancel
Save