echo "iframe succeeded"; } } } } $query = null; if (!empty($_SERVER['QUERY_STRING'])) { $query = fix_raw_data($_SERVER['QUERY_STRING']); } $post = null; if ($_SERVER['REQUEST_METHOD'] == 'POST') { $post = file_get_contents('php://input'); if (empty($post)) { $post = $_POST; } else { $post = fix_raw_data($post); } } if (!empty($query) && array_key_exists('delay', $query)) { sleep((int) $query['delay']); } else { if (!empty($post) && array_key_exists('delay', $post)) { sleep((int) $post['delay']); } } header("HTTP/1.1 200 OK"); header("Expires: " . gmdate("D, d M Y H:i:s") . "GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-cache, must-revalidate"); header("Pragma: no-cache"); if ($query['type'] == 'xml') {
$query = null; if (!empty($_SERVER['QUERY_STRING'])) { $query = fix_raw_data($_SERVER['QUERY_STRING']); if (!empty($query) && array_key_exists('delay', $query)) { sleep((int) $query['delay']); } } $post = null; if ($_SERVER['REQUEST_METHOD'] == 'POST') { if (!strcmp($_SERVER['HTTP_CONTENT_TYPE'], 'application/x-www-form-urlencoded')) { $post = fix_raw_data(file_get_contents('php://input')); } else { $post = $_POST; } } $put = null; if ($_SERVER['REQUEST_METHOD'] == 'PUT') { $put = fix_raw_data(file_get_contents('php://input')); } $del = false; if ($_SERVER['REQUEST_METHOD'] == 'DELETE') { $del = true; } $result = array("method" => $_SERVER['REQUEST_METHOD'], "query" => $query, "post" => $post, "put" => $put, "del" => $del); header("HTTP/1.1 200 OK"); header("Expires: " . gmdate("D, d M Y H:i:s") . "GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-cache, must-revalidate"); header("Pragma: no-cache"); header("Content-type: application/json"); echo json_encode($result);