@@ -190,11 +190,6 @@ public function get($uri = "", $post = null)
190190 return $ this ->go ('GET ' , $ uri , $ post );
191191 }
192192
193- public function put ($ uri , $ post = null )
194- {
195- return $ this ->go ('PUT ' , $ uri , $ post );
196- }
197-
198193 public function post ($ uri , $ post = null )
199194 {
200195 return $ this ->go ('POST ' , $ uri , $ post );
@@ -241,7 +236,7 @@ private function go($method, $uri, $post, $is_retry = false)
241236 if ($ method === "GET " && $ post !== null ) {
242237 $ guzzle_args ['query ' ] = $ post ;
243238 } elseif ($ post !== null ) {
244- $ guzzle_args ['body ' ] = $ post ;
239+ $ guzzle_args ['form_params ' ] = $ post ;
245240 }
246241
247242 if (!$ this ->handle_exceptions ) {
@@ -262,14 +257,13 @@ private function go($method, $uri, $post, $is_retry = false)
262257 private function processRequest ($ method , $ uri , $ post , $ guzzle_args , $ is_retry = false )
263258 {
264259 // special case for PATCHing a Downloadable File
265- if ($ post !== null && is_array ( $ post ) && array_key_exists ('file ' , $ post ) && $ method == 'PATCH ' ) {
260+ if ($ post !== null && array_key_exists ('file ' , $ post ) && $ method == 'PATCH ' ) {
266261 $ method = 'POST ' ;
267262 $ guzzle_args ['headers ' ]['X-HTTP-Method-Override ' ] = 'PATCH ' ;
268263 }
269264
270- $ api_request = $ this ->guzzle ->createRequest ($ method , $ uri , $ guzzle_args );
271- $ this ->last_response = $ this ->guzzle ->send ($ api_request );
272- $ data = $ this ->last_response ->json ();
265+ $ this ->last_response = $ this ->guzzle ->request ($ method , $ uri , $ guzzle_args );
266+ $ data = json_decode ($ this ->last_response ->getBody ()->getContents (),true );
273267 $ this ->saveLinks ($ data );
274268 if ($ this ->hasExpiredAccessTokenError ($ data ) && !$ this ->shouldRefreshToken ()) {
275269 if (!$ is_retry ) {
0 commit comments