PHP Classes

File: test/timeout.php

Recommend this page to a friend!
  Packages of Nikos M.   Eazy HTTP   test/timeout.php   Download  
File: test/timeout.php
Role: Auxiliary script
Content type: text/plain
Description: Configuration script
Class: Eazy HTTP
Send HTTP requests defined with a fluent interface
Author: By
Last change: Update of test/timeout.php
Date: 5 months ago
Size: 412 bytes
 

Contents

Class file image Download
<?php
// run "php -S localhost:9000 test-server.php"
set_time_limit(0);
$method = isset($_SERVER['REQUEST_METHOD']) ? strtoupper((string)$_SERVER['REQUEST_METHOD']) : 'GET';

// simulate timeout
$delay = isset($_GET['delay']) ? intval($_GET['delay']) : 5;

sleep($delay);

http_response_code(200);
header('Content-Type: text/plain; charset=UTF-8', true, 200);
echo
"content after {$delay} seconds";