Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
forCurlError example
protected
function
sendRequest
(
array
$curlOptions
=
[
]
)
: string
{
$ch
=
curl_init
(
)
;
curl_setopt_array
(
$ch
,
$curlOptions
)
;
// Send the request and wait for a response.
$output
=
curl_exec
(
$ch
)
;
if
(
$output
=== false
)
{
throw
HTTPException::
forCurlError
(
(string)
curl_errno
(
$ch
)
,
curl_error
(
$ch
)
)
;
}
curl_close
(
$ch
)
;
return
$output
;
}
}