Following: https://kohanaframework.org/3.2/guide/kohana/requests
I have this code:
$request = Request::factory($url);
$request
->client()
->options(array(
CURLOPT_SSL_VERIFYPEER => FALSE,
CURLOPT_USERPWD => 'test' . ':' . 'token'
));
$response = $request->execute();
$response = json_decode($response);
if(is_array($response) && isset($response['product_feed_url']))
{
echo "Ok Access";
}else{
echo "No Access";
}
Inside a my controller function action_getsettings().
I am using the Request::factory() instead of manual curl and it all works fine, but the problem is that the response of the $request does not get stoerd in the $response - it just outputs directly and exits the controller (it doesnt go to the json_decode and if statement)
Also tried $response = $request->execute()->body();
but it still just outputs as if i did return $response;
Why does this happen?