From 11c397b56673f6d132fb675673efa98dbd012d11 Mon Sep 17 00:00:00 2001 From: ghost Date: Fri, 15 Sep 2023 23:16:00 +0300 Subject: [PATCH] decode response in json by default --- src/library/curl.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/library/curl.php b/src/library/curl.php index 2f2a765..7de42fa 100644 --- a/src/library/curl.php +++ b/src/library/curl.php @@ -89,8 +89,8 @@ class Curl return curl_getinfo($this->_connection, CURLINFO_TOTAL_TIME_T); } - public function getResponse() + public function getResponse(bool $json = true) { - return $this->_response; + return $json ? json_decode($this->_response) : $this->_response; } } \ No newline at end of file