From 52fac5a469b8bf921ccf779b022f4caf3306da93 Mon Sep 17 00:00:00 2001 From: chujiu Date: Mon, 11 Mar 2019 16:02:00 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E7=94=A8client=20=E5=A2=9E=E5=8A=A0op?= =?UTF-8?q?tions=20=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Client.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Client.php b/src/Client.php index d7333cc..b8f0cec 100644 --- a/src/Client.php +++ b/src/Client.php @@ -63,7 +63,7 @@ class Client extends JsonRpc * @throws RpcServerException * @return array */ - public function call($name, $arguments, $header = []) + public function call($name, $arguments, $options = []) { $payload = [ 'jsonrpc' => '2.0', @@ -71,7 +71,7 @@ class Client extends JsonRpc 'params' => $arguments, 'id' => $this->id(), ]; - return $this->post($payload, $header); + return $this->post($payload, $options); } /** @@ -90,17 +90,17 @@ class Client extends JsonRpc * @throws RpcServerException * @return array */ - protected function post($payload, $header = []) + protected function post($payload, $options = []) { try { $headers = [ 'X-Client-App' => $this->config['app'], ]; app('rpc.logger')->info("client_request", array_merge($this->server_config, $payload)); - $resp = $this->http->request('POST', 'rpc/json-rpc-v2.json', [ - 'headers' => array_merge($headers, $header), + $resp = $this->http->request('POST', 'rpc/json-rpc-v2.json', array_merge([ + 'headers' => $headers, 'json' => $payload, - ]); + ], $options)); } catch (ServerException $e) { $ex = new RpcServerException(self::ErrorMsg[JsonRpc::Rpc_Error_Internal_Error], JsonRpc::Rpc_Error_Internal_Error); if (env("APP_DEBUG") == true) {