Skip to content

Commit

Permalink
fix ssl vefication error from local environment
Browse files Browse the repository at this point in the history
  • Loading branch information
arif98741 committed Aug 13, 2022
1 parent aadd8a6 commit d5a800e
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions src/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class Request
/**
* @param false $verify
* @throws GuzzleException
* @throws RenderException
*/
public function get($requestUrl, array $query, bool $verify = false, $timeout = 10.0)
{
Expand All @@ -22,10 +23,15 @@ public function get($requestUrl, array $query, bool $verify = false, $timeout =
'timeout' => $timeout,
]);

return $client->request('GET', '', [
'query' => $query,
'verify' => $verify
]);
try {
return $client->request('GET', '', [
'query' => $query,
'verify' => $verify
]);
} catch (GuzzleException|ClientException $e) {
throw new RenderException($e->getMessage());
}


}

Expand All @@ -40,7 +46,9 @@ public function post($requestUrl, array $query, bool $verify = false, $timeout =
try {

return $client->post($requestUrl, [
RequestOptions::JSON => $query
RequestOptions::JSON => $query,
'verify' => $verify,
'timeout' => $timeout,
]);

} catch (GuzzleException|ClientException $e) {
Expand Down

0 comments on commit d5a800e

Please sign in to comment.