@@ -122,7 +122,7 @@ protected function pureGet(string $path, array $params = [], array $headers = []
122122 $ path .= '? ' .http_build_query ($ params );
123123 }
124124
125- return $ this ->client ->get ($ path , $ headers );
125+ return $ this ->client ->get (self :: computePath ( $ path) , $ headers );
126126 }
127127
128128 /**
@@ -160,7 +160,7 @@ protected function post(string $path, array $params = [], array $headers = [])
160160 */
161161 protected function postRaw (string $ path , $ body = null , array $ headers = [])
162162 {
163- $ response = $ this ->client ->post ($ path , $ headers , $ body );
163+ $ response = $ this ->client ->post (self :: computePath ( $ path) , $ headers , $ body );
164164
165165 return ResponseMediator::getContent ($ response );
166166 }
@@ -200,7 +200,7 @@ protected function put(string $path, array $params = [], array $headers = [])
200200 */
201201 protected function putRaw (string $ path , $ body = null , array $ headers = [])
202202 {
203- $ response = $ this ->client ->put ($ path , $ headers , $ body );
203+ $ response = $ this ->client ->put (self :: computePath ( $ path) , $ headers , $ body );
204204
205205 return ResponseMediator::getContent ($ response );
206206 }
@@ -240,7 +240,7 @@ protected function delete(string $path, array $params = [], array $headers = [])
240240 */
241241 protected function deleteRaw (string $ path , $ body = null , array $ headers = [])
242242 {
243- $ response = $ this ->client ->delete ($ path , $ headers , $ body );
243+ $ response = $ this ->client ->delete (self :: computePath ( $ path) , $ headers , $ body );
244244
245245 return ResponseMediator::getContent ($ response );
246246 }
@@ -267,6 +267,18 @@ protected static function buildPath(string ...$parts)
267267 return implode ('/ ' , $ parts );
268268 }
269269
270+ /**
271+ * Compute the prefixed API path.
272+ *
273+ * @param string $path
274+ *
275+ * @return string
276+ */
277+ private static function computePath (string $ path )
278+ {
279+ return sprintf ('/2.0/%s ' , $ path );
280+ }
281+
270282 /**
271283 * Create a JSON encoded version of an array of params.
272284 *
0 commit comments