From ddf5f6db5a0f9ede4ab7250a3b48dd2636e13c11 Mon Sep 17 00:00:00 2001 From: Jonathan Henrique Date: Wed, 23 Nov 2022 22:18:01 -0300 Subject: [PATCH] fix error sintaxe --- src/ApiBrasil.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/ApiBrasil.php b/src/ApiBrasil.php index d668685..010d1e8 100644 --- a/src/ApiBrasil.php +++ b/src/ApiBrasil.php @@ -36,15 +36,14 @@ public static function WhatsAppService(String $action = '', Array $data = []) { $clear = ['serverhost', 'apitoken', 'method']; $body = array_diff_key($data, array_flip($clear)); - $header = [ + $headers = [ 'sessionkey' => $sessionkey ]; - //verify is a start, is true, add new apitoken in header + //verify is a start, is true, add new apitoken in headers if(isset($action) and $action === 'start'){ - 'sessionkey:'.$sessionkey - $header = [ + $headers = [ 'apitoken' => $apitoken, 'sessionkey' => $sessionkey ]; @@ -64,8 +63,8 @@ public static function WhatsAppService(String $action = '', Array $data = []) { $action = $action."?session=$session&sessionkey=$sessionkey"; } - //guzzle json request post with header - $response = self::defaultRequest($method, $base_uri, $action, $header, $body); + //guzzle json request post with headers + $response = self::defaultRequest($method, $base_uri, $action, $headers, $body); //return response json return $response;