From 02bb86d7729b483389d5b72e87909b8c2841fc24 Mon Sep 17 00:00:00 2001 From: Vincent BRIDIER Date: Wed, 9 Dec 2020 12:09:23 +0100 Subject: [PATCH] - Update retour curl --- clients/LDCCRM_V1.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/clients/LDCCRM_V1.php b/clients/LDCCRM_V1.php index 8532e31..0eafc26 100644 --- a/clients/LDCCRM_V1.php +++ b/clients/LDCCRM_V1.php @@ -121,10 +121,10 @@ class ApiV1 if (!curl_errno($curl)) { $http_code = curl_getinfo($curl, CURLINFO_HTTP_CODE); - if ($http_code !== 200) - return ['status' => 'KO', 'code' => 500, 'message' => 'Connection to API failed']; + if (!in_array($http_code, [200, 201])) + return (object) ['status' => 'KO', 'code' => 500, 'message' => 'Connection to API failed']; } else { - return ['status' => 'KO', 'code' => 500, 'message' => 'Connection to API failed']; + return (object) ['status' => 'KO', 'code' => 500, 'message' => 'Connection to API failed']; } curl_close($curl);