| @@ 77-86 (lines=10) @@ | ||
| 74 | * @param array $parameters |
|
| 75 | * @return Response |
|
| 76 | */ |
|
| 77 | public function get($endpoint, array $parameters = array()) |
|
| 78 | { |
|
| 79 | if (!empty($parameters)) { |
|
| 80 | $path = sprintf("%s?%s", $endpoint, http_build_query($parameters)); |
|
| 81 | } else { |
|
| 82 | $path = $endpoint; |
|
| 83 | } |
|
| 84 | ||
| 85 | return $this->execute("GET", sprintf("%s%s", $this->host, $path)); |
|
| 86 | } |
|
| 87 | ||
| 88 | /** |
|
| 89 | * Make a post request to the given endpoint |
|
| @@ 136-145 (lines=10) @@ | ||
| 133 | * @param array $queryparameters |
|
| 134 | * @return Response |
|
| 135 | */ |
|
| 136 | public function update($endpoint, array $parameters = array(), array $queryparameters = array()) |
|
| 137 | { |
|
| 138 | if (!empty($queryparameters)) { |
|
| 139 | $path = sprintf("%s?%s", $endpoint, http_build_query($queryparameters)); |
|
| 140 | } else { |
|
| 141 | $path = $endpoint; |
|
| 142 | } |
|
| 143 | ||
| 144 | return $this->execute("PATCH", sprintf("%s%s", $this->host, $path), $parameters); |
|
| 145 | } |
|
| 146 | ||
| 147 | /** |
|
| 148 | * Return the headers from the last request |
|