@@ 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 |
|
@@ 123-132 (lines=10) @@ | ||
120 | * @param array $queryparameters |
|
121 | * @return Response |
|
122 | */ |
|
123 | public function update($endpoint, array $parameters = array(), array $queryparameters = array()) |
|
124 | { |
|
125 | if (!empty($queryparameters)) { |
|
126 | $path = sprintf("%s/?%s", $endpoint, http_build_query($queryparameters)); |
|
127 | } else { |
|
128 | $path = $endpoint; |
|
129 | } |
|
130 | ||
131 | return $this->execute("PATCH", sprintf("%s%s", $this->host, $path), $parameters); |
|
132 | } |
|
133 | ||
134 | /** |
|
135 | * Return the headers from the last request |