@@ 122-136 (lines=15) @@ | ||
119 | * @param string $contentType |
|
120 | * @return array |
|
121 | */ |
|
122 | public function get($ressourceName, $ressourcePath =null, $ressourceId = null, $query = array(), |
|
123 | $assoc = false, $contentType = 'json') |
|
124 | { |
|
125 | try { |
|
126 | $urlRessource = $this->builPathToCall($ressourceName, $ressourcePath, $ressourceId); |
|
127 | $response = $this->getClient()->get($urlRessource, |
|
128 | array( |
|
129 | 'headers' => ['Accept' => "application/$contentType"], |
|
130 | 'query' => $query |
|
131 | )); |
|
132 | } catch (ClientException $ex) { |
|
133 | $response = $ex->getResponse(); |
|
134 | } |
|
135 | return $this->makeCertainApiResponse($response, $contentType, $assoc); |
|
136 | } |
|
137 | ||
138 | /** |
|
139 | * Make "POST" request with the client. |
|
@@ 211-224 (lines=14) @@ | ||
208 | * @param string $contentType |
|
209 | * @return array |
|
210 | */ |
|
211 | public function delete($ressourceName, $ressourcePath =null, $ressourceId = null, $assoc = false, |
|
212 | $contentType = 'json') |
|
213 | { |
|
214 | try { |
|
215 | $urlRessource = $this->builPathToCall($ressourceName, $ressourcePath, $ressourceId); |
|
216 | $response = $this->getClient()->delete($urlRessource, |
|
217 | array( |
|
218 | 'headers' => ['Accept' => "application/$contentType"], |
|
219 | )); |
|
220 | } catch (ClientException $ex) { |
|
221 | $response = $ex->getResponse(); |
|
222 | } |
|
223 | return $this->makeCertainApiResponse($response, $contentType, $assoc); |
|
224 | } |
|
225 | ||
226 | /** |
|
227 | * Make the Certain Api repsonse. |