Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set CURL options when using Kohana Request

Trying to use the Request class to get an external resources, but can't figure out how to set more default curl options.

I get the data like this:

$data = Request::factory($url)->execute()->body();

I figured adding CURL options was a simple matter of making a copy of system/config/curl.php into my application config folder and then setting the options there (I assume they will be merged?).

But those options don't seem to be used at all? Tried to do a var_dump in Kohana_Request_Client_Curl after all the options should've been set, but I can only find the ones set directly there in that method, which makes sense as I can't seem to find anywhere these options are actually fetched from the config file...

What am I doing wrong here?

like image 528
Svish Avatar asked Dec 06 '25 07:12

Svish


1 Answers

Here is more detailed example:

$request = Request::factory($some_url);

$request->client()->options(array(
    CURLOPT_SSL_VERIFYPEER => FALSE
));
like image 116
matino Avatar answered Dec 08 '25 21:12

matino



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!