N
N
Nikolay2016-03-16 18:38:01
Kohana
Nikolay, 2016-03-16 18:38:01

How to process request through proxy in kohana framework?

How to process this request through a proxy?

$request = Request::factory($url)->method(Request::GET)->headers(array('Content-Type'=> 'application/json', 'referer'=> $url));

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
Jurasik, 2016-03-17
@Jurasik

It is possible, for example:

$request = Request::factory($url)
    ->method(Request::GET)
    ->headers(array('Content-Type'=> 'application/json', 'referer'=> $url));

$request->client()->options(array(
    CURLOPT_PROXY => $host,
    CURLOPT_TIMEOUT => 10,
    ));
$request->execute()->body();

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question