| @@ 73-78 (lines=6) @@ | ||
| 70 | * @param array $params |
|
| 71 | * @return array response |
|
| 72 | */ |
|
| 73 | public static function get($path = null, array $params = []) { |
|
| 74 | self::builUrl($path, $params); |
|
| 75 | $client = static::getClient()->request('GET', static::getUrl()); |
|
| 76 | static::$requestCount++; |
|
| 77 | return new Response($client); |
|
| 78 | } |
|
| 79 | ||
| 80 | /** |
|
| 81 | * |
|
| @@ 86-91 (lines=6) @@ | ||
| 83 | * @param array $headers |
|
| 84 | * @return array response |
|
| 85 | */ |
|
| 86 | public static function post($path = null, array $headers = []) { |
|
| 87 | self::builUrl($path, $headers); |
|
| 88 | static::$requestCount++; |
|
| 89 | $client = (new HttpClient(static::$options))->request('POST', static::getUrl(), $headers = []); |
|
| 90 | return new Response($client); |
|
| 91 | } |
|
| 92 | ||
| 93 | /** |
|
| 94 | * |
|