@@ 76-85 (lines=10) @@ | ||
73 | * @param array $parameters |
|
74 | * @return Response |
|
75 | */ |
|
76 | public function get($endpoint, array $parameters = array()) |
|
77 | { |
|
78 | if (!empty($parameters)) { |
|
79 | $path = sprintf("%s/?%s", $endpoint, http_build_query($parameters)); |
|
80 | } else { |
|
81 | $path = $endpoint; |
|
82 | } |
|
83 | ||
84 | return $this->execute("GET", sprintf("%s%s", $this->host, $path)); |
|
85 | } |
|
86 | ||
87 | /** |
|
88 | * Make a post request to the given endpoint |
|
@@ 122-131 (lines=10) @@ | ||
119 | * @param array $queryparameters |
|
120 | * @return Response |
|
121 | */ |
|
122 | public function update($endpoint, array $parameters = array(), array $queryparameters = array()) |
|
123 | { |
|
124 | if (!empty($queryparameters)) { |
|
125 | $path = sprintf("%s/?%s", $endpoint, http_build_query($queryparameters)); |
|
126 | } else { |
|
127 | $path = $endpoint; |
|
128 | } |
|
129 | ||
130 | return $this->execute("PATCH", sprintf("%s%s", $this->host, $path), $parameters); |
|
131 | } |
|
132 | ||
133 | /** |
|
134 | * Return the headers from the last request |