Files
42_INT_12_webserv/srcs/cgi-bin/cgi_cpp_sleep.cpp
2022-08-16 20:28:40 +02:00

28 lines
430 B
C++

# include "cgi_utils.hpp"
int main (int ac, char **av, char ** env)
{
std::string http_header;
std::string http_body;
std::string rq_body;
size_t time;
std::stringstream ss;
std::cin >> rq_body;
(void)ac;
(void)av;
fill_response_basic(env, http_body, http_header, rq_body);
ss << get_value("sleep", rq_body);
ss >> time;
sleep(time);
std::cout << http_header << CRLF CRLF << http_body;
return 0;
}