Skip to content

Commit

Permalink
Merge pull request #27 from hhxsv5/master
Browse files Browse the repository at this point in the history
fix json_encode with JSON_UNESCAPED_SLASHES
  • Loading branch information
谢彪 authored Mar 1, 2019
2 parents 33b3ff4 + aad9689 commit d1e7f69
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Http/GuzzleHttp.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ public function request(Request $request, $timeout = 30)
break;
case Request::METHOD_PUT:
case Request::METHOD_POST:
$hasParam AND $options['json'] = $params;
if ($hasParam) {
$options['headers']['Content-Type'] = 'application/json';
$options['body'] = json_encode($params, JSON_UNESCAPED_SLASHES);
}
break;
default:
$exception = new HttpException('Unsupported method ' . $method, 0);
Expand Down

0 comments on commit d1e7f69

Please sign in to comment.