#include "incredis/incredis.hpp" #include "submit_form_response.hpp" #include "cgi_env.hpp" #include "cgi_post.hpp" #include #include //www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4150.pdf namespace { } //unnamed namespace int main() { //std::cout << "Content-type:text/plain\n\n"; redis::IncRedis incredis("127.0.0.1", 6379); tawashi::SubmitFormResponse resp; resp.send(); tawashi::CGIEnv cgi_env; for (auto& pair : cgi_env.query_string_split()) { std::cout << "first:\t\"" << pair.first << "\"\tsecond:\t\"" << pair.second << "\"\n"; } const std::size_t in_len = cgi_env.content_length(); std::cout << "\n
\n"; std::cout << "Content length: \"" << in_len << "\"\n
\n"; cgi_env.print_all(std::cout, "
\n"); for (auto& itm : tawashi::cgi::read_post(cgi_env)) { std::cout << "Key: \"" << itm.first << "\"
\nValue: \"" << itm.second << "\"
\n"; } auto ver = cgi_env.gateway_interface(); if (ver) std::cout << ver->name << " - v" << ver->major << ',' << ver->minor << "
\n"; return 0; }