Question : get http code curl php
Answered by : indonesia-people
$result = curl_exec($ch);
$httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($httpcode == 200){ return json_decode($result);
}
Source : | Last Update : Wed, 04 May 22
Question : get curl httcode php
Answered by : indonesia-people
$httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
Source : | Last Update : Wed, 20 Apr 22
Question : PHP cURL request
Answered by : amrinder-singh-bajwa
function &web_curl_http($url)
{ $c = curl_init(); curl_setopt( $c , CURLOPT_URL , $url); curl_setopt( $c , CURLOPT_USERAGENT, "Mozilla/5.0 (Linux Centos 7;) Chrome/74.0.3729.169 Safari/537.36"); curl_setopt( $c , CURLOPT_RETURNTRANSFER, true); curl_setopt( $c , CURLOPT_SSL_VERIFYPEER, false); curl_setopt( $c , CURLOPT_SSL_VERIFYHOST, false); curl_setopt( $c , CURLOPT_TIMEOUT, 10000); // 10 sec $data = curl_exec($c); curl_close($c); return $data;
}
Source : https://stackoverflow.com/questions/58674511/simple-php-curl-get-request-not-working-at-all | Last Update : Fri, 17 Jun 22
Question : php curl request
Answered by : karan-mehta-8dc1x4jfp7we
$ch = curl_init();
$curlConfig = array( CURLOPT_URL => "http://www.example.com/yourscript.php", CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_POSTFIELDS => array( 'field1' => 'some date', 'field2' => 'some other data', )
);
curl_setopt_array($ch, $curlConfig);
$result = curl_exec($ch);
curl_close($ch);
Source : | Last Update : Wed, 10 Aug 22