Skip to content

Commit b01779e

Browse files
committed
不绑定JSON
1 parent 6c6c687 commit b01779e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/ApiGateway.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use yii\base\InvalidConfigException;
1313
use yii\httpclient\Client;
1414
use yii\httpclient\RequestEvent;
15+
use yii\httpclient\Response;
1516

1617
/**
1718
* Class ApiGateway
@@ -60,7 +61,6 @@ public function init()
6061
if (empty ($this->secretKey)) {
6162
throw new InvalidConfigException ('The "secretKey" property must be set.');
6263
}
63-
$this->responseConfig['format'] = Client::FORMAT_JSON;
6464
$this->on(Client::EVENT_BEFORE_SEND, [$this, 'RequestEvent']);
6565
}
6666

@@ -94,7 +94,7 @@ public function RequestEvent(RequestEvent $event)
9494
* @param array|string $data
9595
* @param array $headers
9696
* @param array $options
97-
* @return array response data.
97+
* @return Response response data.
9898
* @throws Exception
9999
*/
100100
public function sendRequest($method, $url, $data, $headers, $options)
@@ -113,6 +113,6 @@ public function sendRequest($method, $url, $data, $headers, $options)
113113
if (!$response->isOk) {
114114
throw new Exception('Request fail. response: ' . $response->content, $response->statusCode);
115115
}
116-
return $response->data;
116+
return $response;
117117
}
118118
}

0 commit comments

Comments
 (0)