Welcome Guest, Not a member yet? Register   Sign In
CURLRequest extends
#3

Ci4

I overwrote $client = \Config\Services::mycurlrequest();
and

    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);
        $this->requestInfo = curl_getinfo($ch);
        return $output;
    }

And it works - but it's probably not the best idea
Reply


Messages In This Thread
CURLRequest extends - by okatse - 04-07-2024, 08:19 AM
RE: CURLRequest extends - by Bosborne - 04-07-2024, 10:05 AM
RE: CURLRequest extends - by okatse - 04-07-2024, 11:32 AM



Theme © iAndrew 2016 - Forum software by © MyBB