script test sleep input by user
This commit is contained in:
@@ -3,9 +3,11 @@
|
|||||||
|
|
||||||
int main (int ac, char **av, char ** env)
|
int main (int ac, char **av, char ** env)
|
||||||
{
|
{
|
||||||
std::string http_header;
|
std::string http_header;
|
||||||
std::string http_body;
|
std::string http_body;
|
||||||
std::string rq_body;
|
std::string rq_body;
|
||||||
|
size_t time;
|
||||||
|
std::stringstream ss;
|
||||||
|
|
||||||
std::cin >> rq_body;
|
std::cin >> rq_body;
|
||||||
|
|
||||||
@@ -14,7 +16,9 @@ int main (int ac, char **av, char ** env)
|
|||||||
|
|
||||||
fill_response_basic(env, http_body, http_header, rq_body);
|
fill_response_basic(env, http_body, http_header, rq_body);
|
||||||
|
|
||||||
sleep(60);
|
ss << get_value("sleep", rq_body);
|
||||||
|
ss >> time;
|
||||||
|
sleep(time);
|
||||||
|
|
||||||
std::cout << http_header << CRLF CRLF << http_body;
|
std::cout << http_header << CRLF CRLF << http_body;
|
||||||
|
|
||||||
|
|||||||
@@ -204,6 +204,8 @@
|
|||||||
<input type="text" id="fname" name="fname" value="John"><br>
|
<input type="text" id="fname" name="fname" value="John"><br>
|
||||||
<label for="lname">Last name:</label><br>
|
<label for="lname">Last name:</label><br>
|
||||||
<input type="text" id="lname" name="lname" value="Doe"><br><br>
|
<input type="text" id="lname" name="lname" value="Doe"><br><br>
|
||||||
|
<label for="sleep">Sleep time:</label><br>
|
||||||
|
<input type="text" id="sleep" name="sleep" value="5"><br><br>
|
||||||
<input type="submit" value="submit">
|
<input type="submit" value="submit">
|
||||||
<h3>expectation:</h3>
|
<h3>expectation:</h3>
|
||||||
<p>the request will sleep for one minute</p>
|
<p>the request will sleep for one minute</p>
|
||||||
@@ -427,6 +429,8 @@
|
|||||||
<input type="text" id="fname" name="fname" value="John"><br>
|
<input type="text" id="fname" name="fname" value="John"><br>
|
||||||
<label for="lname">Last name:</label><br>
|
<label for="lname">Last name:</label><br>
|
||||||
<input type="text" id="lname" name="lname" value="Doe"><br><br>
|
<input type="text" id="lname" name="lname" value="Doe"><br><br>
|
||||||
|
<label for="sleep">Sleep time:</label><br>
|
||||||
|
<input type="text" id="sleep" name="sleep" value="5"><br><br>
|
||||||
<input type="submit" value="submit">
|
<input type="submit" value="submit">
|
||||||
<h3>expectation:</h3>
|
<h3>expectation:</h3>
|
||||||
<p>the request will sleep for one minute</p>
|
<p>the request will sleep for one minute</p>
|
||||||
|
|||||||
Reference in New Issue
Block a user