From f8a43205e26c922d4d0eae44bb54ffbd80987294 Mon Sep 17 00:00:00 2001 From: intodeep Date: Tue, 9 Feb 2021 15:35:24 +0100 Subject: [PATCH] release 1.0.2: implemented token based authentication --- README.md | 16 +++++++++++++++- src/Deepser.php | 34 +++++++++++++++++++++++++++++++--- 2 files changed, 46 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 8ec1577..cfeab60 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ Or edit `composer.json` and add: Example ------- - +Login with Basic Authentication ```php 'Basic ' . $token, - 'Accept' => 'application/json', + $headers = [ + 'Accept' => 'application/json' ]; + if(self::$_authType == self::AUTH_BASIC){ + $headers['Authorization'] = 'Basic ' . $token; + }else{ + $headers['Authorization'] = 'Bearer ' . self::$_token; + } + + return $headers; } } \ No newline at end of file