From 77d28d26b4eb11f558f023ba8358e5d4db14b3db Mon Sep 17 00:00:00 2001 From: ishmukhametov_tf Date: Sun, 18 Aug 2024 16:13:13 +0300 Subject: [PATCH] add new required headers --- src/Client.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Client.php b/src/Client.php index f7874b5..5ab3e62 100644 --- a/src/Client.php +++ b/src/Client.php @@ -14,6 +14,10 @@ final class Client { + public const HEADER_CONTENT_TYPE = 'application/json'; + + public const HEADER_ORIGIN = 'https://store.playstation.com'; + public readonly RequestLocatorService $requestServiceLocator; public function __construct( @@ -76,16 +80,15 @@ public function getResponse(BaseRequest $request): ResponseInterface ), [ 'headers' => [ - 'x-psn-store-locale-override' => $this->regionEnum->value + 'x-psn-store-locale-override' => $this->regionEnum->value, + 'content-type' => self::HEADER_CONTENT_TYPE, + 'origin' => self::HEADER_ORIGIN, ], ] ); } catch (Exception|GuzzleException $e) { - var_dump($e->getMessage()); - - exit(); throw new ResponseException( $request, 'An error occurred while trying to request',