mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-10-06 12:06:50 +00:00
Use request header to specify test being run
This commit is contained in:
+5
-1
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
$request_method = isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : '';
|
||||
$data_values = $request_method === 'POST' ? $_POST : $_GET;
|
||||
$test = isset($data_values['test']) ? $data_values['test'] : '';
|
||||
$test = isset($_SERVER['HTTP_X_DEBUG_TEST']) ? $_SERVER['HTTP_X_DEBUG_TEST'] : '';
|
||||
$key = isset($data_values['key']) ? $data_values['key'] : '';
|
||||
|
||||
if ($test == 'http_basic_auth') {
|
||||
@@ -19,6 +19,10 @@ if ($test == 'http_basic_auth') {
|
||||
));
|
||||
exit;
|
||||
}
|
||||
else if ($test === 'post') {
|
||||
echo http_build_query($_POST);
|
||||
exit;
|
||||
}
|
||||
else if ($test === 'post_multidimensional') {
|
||||
$http_raw_post_data = file_get_contents('php://input');
|
||||
echo $http_raw_post_data;
|
||||
|
||||
Reference in New Issue
Block a user