From 358cc5564676efd4efdd9eaf2c8ab1fd1d9b3733 Mon Sep 17 00:00:00 2001 From: lyy Date: Tue, 30 Mar 2021 16:58:05 +0800 Subject: [PATCH] FIX: when request full url, make the url itself query string valid --- src/Service/AbstractService.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Service/AbstractService.php b/src/Service/AbstractService.php index 6efe4e5..8bda173 100644 --- a/src/Service/AbstractService.php +++ b/src/Service/AbstractService.php @@ -79,10 +79,12 @@ public function getLastResponse() public function send(Request $request, array $params = array()) { $args = array(); - if ($request->getMethod() === 'GET') { - $args['query'] = $params; - } else { - $args['json'] = $params; + if (!empty($params)) { + if ($request->getMethod() === 'GET') { + $args['query'] = $params; + } else { + $args['json'] = $params; + } } $this->lastResponse = $this->client->send($request, $args); return json_decode(