Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/RPC/RpcProxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ public function createRequest($actionName, Route $route, array $args)
}
}
}
if ($body === null && $headers['Content-Type'] == 'application/json') {
// 解决body为空的json请求,接口报错:Uncaught TypeError: Argument 1 passed to Symfony\\Component\\HttpFoundation\\ParameterBag::__construct() must be of the type array, null given
$body = new \stdClass();
}
if($body !== null){
$body = json_encode($body, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
}
Expand Down