Level 53
Just set the proxy options in curl:
// if you have your proxy running on your own PC port 8888
curl_setopt($ch, CURLOPT_PROXY, '127.0.0.1:8888');
// if the proxy also uses auth
//curl_setopt($ch, CURLOPT_PROXYUSERPWD, $proxyauth);
I am trying to run curl in my office environment. But unfortunately i am not able to get the data from curl.and When i use same code at my laptop it is working fine . i don't know where to set the proxy in laravel. please help !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Hey Friends i have got the solution for this problem . i just have to install composer GuzzleHttp and code will work smoothly.
$client = new \GuzzleHttp\Client();
$request_data = $client->get($url);
$response = $request_data->getBody()->getContents();
$AstroList = iconv("ISO-8859-1","UTF-8",$response);
$AstroList = json_decode((string) $AstroList, true);
Please or to participate in this conversation.