Skip to content

Commit

Permalink
get http code return
Browse files Browse the repository at this point in the history
  • Loading branch information
Hotfirenet committed Oct 9, 2023
1 parent 7f91eab commit 057825a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions core/com/http.com.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class com_http {
private $userAgent = '';
private $CURLOPT_HTTPAUTH = '';
private $CURLOPT = array();
private $httpCode = 0;

/* * ********************Fonctions statiques********************* */

Expand Down Expand Up @@ -113,6 +114,7 @@ public function exec($_timeout = 2, $_maxRetry = 3) {
}
}
$response = curl_exec($ch);
$this->httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$nbRetry++;
if (curl_errno($ch) && $nbRetry < $_maxRetry) {
curl_close($ch);
Expand Down Expand Up @@ -289,4 +291,7 @@ public function setCURLOPT($CURLOPT) {
return $this;
}

public function getHttpCode() {
return $this->httpCode;
}
}

0 comments on commit 057825a

Please sign in to comment.