This commit is contained in:
2021-09-07 14:55:21 +08:00
parent 3b2c0a2654
commit 86b432961e
+5 -3
View File
@@ -136,12 +136,14 @@ class Curl extends ClientAbstracts
*/ */
private function execute($curl): Result|bool|array|string private function execute($curl): Result|bool|array|string
{ {
defer(fn() => $this->cleanData());
$output = curl_exec($curl); $output = curl_exec($curl);
if ($output === false) { if ($output === false) {
return $this->fail(400, curl_error($curl)); $response = $this->fail(400, curl_error($curl));
} else {
$response = $this->parseResponse($curl, $output);
} }
return $this->parseResponse($curl, $output); $this->cleanData();
return $response;
} }