Skip to content

Commit

Permalink
Merge pull request #45 from hhxsv5/master
Browse files Browse the repository at this point in the history
Optimize handling json body for swoole http
  • Loading branch information
hhxsv5 authored Apr 19, 2019
2 parents 93058ca + cc98ef1 commit beebef2
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/Http/SwooleHttp.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,7 @@ public function request(Request $request, $timeout = 30)
break;
case Request::METHOD_PUT:
case Request::METHOD_POST:
$params = $request->getParams();
$data = null;
if (!empty($params)) {
$data = json_encode($params, JSON_UNESCAPED_SLASHES);
}
$data = $request->getBodyParams();
/**@var \Swlib\Saber\Response $saberResponse */
$saberResponse = $client->{strtolower($method)}($requestUri, $data);
break;
Expand Down

0 comments on commit beebef2

Please sign in to comment.