Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //Copyright 2016 Dirk Elmendorf
- //This simulates a slow request to a remote api
- if (isset($_GET["seconds"]) && $_GET["seconds"] != "null") {
- $seconds = $_GET["seconds"];
- }
- else {
- $seconds = 5;
- }
- sleep($seconds);
- header('Content-Type: application/json');
- $data = array('delay' => $seconds);
- echo(json_encode($data));
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement