@@ 147-154 (lines=8) @@ | ||
144 | * |
|
145 | * @return array|false Assoc array of API response, decoded from JSON |
|
146 | */ |
|
147 | public function delete($method, $args = array(), $timeout = 0) |
|
148 | { |
|
149 | if ($timeout === 0) { |
|
150 | $timeout = $this->timeout; |
|
151 | } |
|
152 | ||
153 | return $this->makeRequest('delete', $method, $args, $timeout); |
|
154 | } |
|
155 | ||
156 | /** |
|
157 | * Make an HTTP GET request - for retrieving data |
|
@@ 165-172 (lines=8) @@ | ||
162 | * |
|
163 | * @return array|false Assoc array of API response, decoded from JSON |
|
164 | */ |
|
165 | public function get($method, $args = array(), $timeout = 0) |
|
166 | { |
|
167 | if ($timeout === 0) { |
|
168 | $timeout = $this->timeout; |
|
169 | } |
|
170 | ||
171 | return $this->makeRequest('get', $method, $args, $timeout); |
|
172 | } |
|
173 | ||
174 | /** |
|
175 | * Make an HTTP PATCH request - for performing partial updates |
|
@@ 183-190 (lines=8) @@ | ||
180 | * |
|
181 | * @return array|false Assoc array of API response, decoded from JSON |
|
182 | */ |
|
183 | public function patch($method, $args = array(), $timeout = 0) |
|
184 | { |
|
185 | if ($timeout === 0) { |
|
186 | $timeout = $this->timeout; |
|
187 | } |
|
188 | ||
189 | return $this->makeRequest('patch', $method, $args, $timeout); |
|
190 | } |
|
191 | ||
192 | /** |
|
193 | * Make an HTTP POST request - for creating and updating items |
|
@@ 201-208 (lines=8) @@ | ||
198 | * |
|
199 | * @return array|false Assoc array of API response, decoded from JSON |
|
200 | */ |
|
201 | public function post($method, $args = array(), $timeout = 0) |
|
202 | { |
|
203 | if ($timeout === 0) { |
|
204 | $timeout = $this->timeout; |
|
205 | } |
|
206 | ||
207 | return $this->makeRequest('post', $method, $args, $timeout); |
|
208 | } |
|
209 | ||
210 | /** |
|
211 | * Make an HTTP PUT request - for creating new items |
|
@@ 219-225 (lines=7) @@ | ||
216 | * |
|
217 | * @return array|false Assoc array of API response, decoded from JSON |
|
218 | */ |
|
219 | public function put($method, $args = array(), $timeout = 0) |
|
220 | { |
|
221 | if ($timeout === 0) { |
|
222 | $timeout = $this->timeout; |
|
223 | } |
|
224 | return $this->makeRequest('put', $method, $args, $timeout); |
|
225 | } |
|
226 | ||
227 | /** |
|
228 | * Performs the underlying HTTP request. Not very exciting. |