| @@ 40-49 (lines=10) @@ | ||
| 37 | } |
|
| 38 | } |
|
| 39 | ||
| 40 | public function post($path, $params = null) |
|
| 41 | { |
|
| 42 | $response = $this->_doRequest('POST', $path, $this->_buildXml($params)); |
|
| 43 | $responseCode = $response['status']; |
|
| 44 | if($responseCode === 200 || $responseCode === 201 || $responseCode === 422 || $responseCode == 400) { |
|
| 45 | return Xml::buildArrayFromXml($response['body']); |
|
| 46 | } else { |
|
| 47 | Util::throwStatusCodeException($responseCode); |
|
| 48 | } |
|
| 49 | } |
|
| 50 | ||
| 51 | public function put($path, $params = null) |
|
| 52 | { |
|
| @@ 51-60 (lines=10) @@ | ||
| 48 | } |
|
| 49 | } |
|
| 50 | ||
| 51 | public function put($path, $params = null) |
|
| 52 | { |
|
| 53 | $response = $this->_doRequest('PUT', $path, $this->_buildXml($params)); |
|
| 54 | $responseCode = $response['status']; |
|
| 55 | if($responseCode === 200 || $responseCode === 201 || $responseCode === 422 || $responseCode == 400) { |
|
| 56 | return Xml::buildArrayFromXml($response['body']); |
|
| 57 | } else { |
|
| 58 | Util::throwStatusCodeException($responseCode); |
|
| 59 | } |
|
| 60 | } |
|
| 61 | ||
| 62 | private function _buildXml($params) |
|
| 63 | { |
|