Skip to content

Commit db6ae8b

Browse files
author
Openset
committed
Add: request
1 parent 1f837f9 commit db6ae8b

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/HttpClient.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Openset;
44

55
use GuzzleHttp\Client;
6+
use Psr\Http\Message\ResponseInterface;
67

78
class HttpClient
89
{
@@ -20,4 +21,14 @@ public static function getClient()
2021
return self::$client;
2122
}
2223

24+
public static function request($method, $uri = '', array $options = [])
25+
{
26+
$response = self::getClient()->request($method, $uri, $options);
27+
if ($response instanceof ResponseInterface) {
28+
return $response->getBody();
29+
}
30+
31+
return false;
32+
}
33+
2334
}

0 commit comments

Comments
 (0)