- Update retour curl
This commit is contained in:
parent
4685850293
commit
02bb86d772
1 changed files with 3 additions and 3 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue