Last active
December 25, 2015 00:59
-
-
Save pjdietz/6892064 to your computer and use it in GitHub Desktop.
Test an HTTP request. Respond with information about the request.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Return information about the request sent to this script. | |
$request = array( | |
'protocol' => $_SERVER['SERVER_PROTOCOL'], | |
'method' => $_SERVER['REQUEST_METHOD'], | |
'host' => $_SERVER['HTTP_HOST'], | |
'path' => $_SERVER['REQUEST_URI'], | |
'queryString' => $_SERVER['QUERY_STRING'], | |
'headers' => apache_request_headers(), | |
'queryFields' => $_GET, | |
'formFields' => $_POST, | |
'body' => file_get_contents("php://input") | |
); | |
header('Content-type: application/json'); | |
print json_encode($request); | |
exit; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment