From f3fbe337178fe19e6272593220e8ebaf5fc4b8fc Mon Sep 17 00:00:00 2001 From: jbousquie Date: Wed, 16 Nov 2016 11:40:56 +0100 Subject: [PATCH] fix HTTP_Request2 --- admin/taches.php | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/admin/taches.php b/admin/taches.php index e55863a..253504b 100644 --- a/admin/taches.php +++ b/admin/taches.php @@ -1,21 +1,22 @@ send(); - if ($r->getResponseCode() == 200) { - $r->getResponseBody(); - $reponse = json_decode($r->getResponseBody()); + $response = $r->send(); + if (200 == $response->getStatus()) { + $body = $response->getBody(); + $taches = json_decode($body); } } - catch (HttpException $ex) { - echo $ex; + catch (HTTP_Request2_Exception $ex) { + echo $ex->getMessage(); } - return $reponse; + return $taches; } // Variables