Browse Source

测试接收数据 并保存到日志

master
wanghongjun 2 years ago
parent
commit
080ce2fed1
  1. 4
      app/controller/Index.php

4
app/controller/Index.php

@ -2,6 +2,8 @@
namespace app\controller;
use app\BaseController;
use think\facade\Log;
use think\facade\Request;
class Index extends BaseController
{
@ -18,8 +20,10 @@ class Index extends BaseController
// 测试连接
public function msg(){
$handle = fopen('php://input', 'r');
$param = Request::param() ?? [];
$input = stream_get_contents($handle);
fclose($handle);
Log::info('HTTP',$param);
echo $input;
}
}

Loading…
Cancel
Save