@@ 54-63 (lines=10) @@ | ||
51 | * @param array $params |
|
52 | * @return array |
|
53 | */ |
|
54 | public function post($url, array $params = []) |
|
55 | { |
|
56 | $response = $this->client->post($this->getUrl($url), [ |
|
57 | 'headers' => $this->getHeaders(), |
|
58 | 'auth' => $this->getAuth(), |
|
59 | 'json' => $params, |
|
60 | ]); |
|
61 | ||
62 | return json_decode((string) $response->getBody(), true); |
|
63 | } |
|
64 | ||
65 | /** |
|
66 | * @param string $url |
|
@@ 115-124 (lines=10) @@ | ||
112 | * @param array $params |
|
113 | * @return array |
|
114 | */ |
|
115 | public function get($url, array $params = []) |
|
116 | { |
|
117 | $response = $this->client->get($this->getUrl($url), [ |
|
118 | 'headers' => $this->getHeaders(), |
|
119 | 'auth' => $this->getAuth(), |
|
120 | 'query' => $params, |
|
121 | ]); |
|
122 | ||
123 | return json_decode((string) $response->getBody(), true); |
|
124 | } |
|
125 | ||
126 | /** |
|
127 | * @param string $url |
|
@@ 131-140 (lines=10) @@ | ||
128 | * @param array $params |
|
129 | * @return array |
|
130 | */ |
|
131 | public function put($url, array $params = []) |
|
132 | { |
|
133 | $response = $this->client->put($this->getUrl($url), [ |
|
134 | 'headers' => $this->getHeaders(), |
|
135 | 'auth' => $this->getAuth(), |
|
136 | 'json' => $params, |
|
137 | ]); |
|
138 | ||
139 | return json_decode((string) $response->getBody(), true); |
|
140 | } |
|
141 | ||
142 | /** |
|
143 | * @param string $url |