Test run for Curl URL Requests

This commit is contained in:
Clemens Schwaighofer
2024-10-21 09:32:20 +09:00
parent 50a4b88f55
commit 3c5200cd99
3 changed files with 9 additions and 4 deletions

View File

@@ -139,9 +139,7 @@ class Curl implements Interface\RequestsInterface
// init curl handle
$handle = $this->handleCurleInit($url);
// set the standard curl options
if ($headers !== []) {
$this->setCurlOptions($handle, $headers);
}
$this->setCurlOptions($handle, $headers);
// for post we set POST option
if ($type == "post") {
curl_setopt($handle, CURLOPT_POST, true);
@@ -205,7 +203,9 @@ class Curl implements Interface\RequestsInterface
if (!empty($this->auth_ident)) {
curl_setopt($handle, CURLOPT_USERPWD, $this->auth_ident);
}
curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);
if ($headers !== []) {
curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);
}
// curl_setopt($handle, CURLOPT_FAILONERROR, true);
curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
// for debug only