diff --git a/www/admin/UrlReqeusts.target.php b/www/admin/UrlReqeusts.target.php new file mode 100644 index 00000000..79feafde --- /dev/null +++ b/www/admin/UrlReqeusts.target.php @@ -0,0 +1,35 @@ + BASE . LOG, + 'log_file_id' => $LOG_FILE_ID, + 'log_per_date' => true, +]); + +$http_headers = array_filter($_SERVER, function ($value, $key) { + if (str_starts_with($key, 'HTTP_')) { + return true; + } +}, ARRAY_FILTER_USE_BOTH); + +$file_get = file_get_contents('php://input'); +// str_replace('\"', '"', trim($file_get, '"')); + +$log->debug('SERVER', $log->prAr($_SERVER)); +$log->debug('HEADERS', $log->prAr($http_headers)); +$log->debug('POST', $log->prAr($_POST)); +$log->debug('PHP-INPUT', $log->prAr($file_get)); + +print Json::jsonConvertArrayTo([ + 'HTTP_HEADERS' => $http_headers, + "_GET" => $_GET, + "_POST" => Json::jsonConvertToArray($file_get), +]); + +$log->debug('[END]', '=========================================>'); + +// __END__ diff --git a/www/admin/class_test.url-requests.curl.php b/www/admin/class_test.url-requests.curl.php index d34a85d6..32d6931a 100644 --- a/www/admin/class_test.url-requests.curl.php +++ b/www/admin/class_test.url-requests.curl.php @@ -35,13 +35,88 @@ print "
"; print ''; print '" . print_r($data, true) . ""; print "
" . print_r($data, true) . ""; +$data = $client->requestPost( + 'https://soba.egplusww.jp/developers/clemens/core_data/php_libraries/trunk/www/admin/UrlReqeusts.target.php' + . '?other=post_a', + ['payload' => 'data post'], + [ + 'Content-Type: application/json', + 'Accept: application/json', + 'test-header: ABC', + 'info-request-type: _POST' + ], + ['foo' => 'BAR post'], +); +print "_POST RESPONSE:
" . print_r($data, true) . ""; + print "
" . print_r($data, true) . ""; + +print "
" . print_r($data, true) . ""; + +print "
" . print_r($data, true) . ""; +$data = $client->requestDelete( + 'https://soba.egplusww.jp/developers/clemens/core_data/php_libraries/trunk/www/admin/UrlReqeusts.target.php' + . '?other=delete_body_a', + ['payload' => 'data delete'], + [ + 'Content-Type: application/json', + 'Accept: application/json', + 'test-header: ABC', + 'info-request-type: _DELETE' + ], + ['foo' => 'BAR delete'], +); +print "_DELETE RESPONSE:
" . print_r($data, true) . ""; + print "