Skip to content

Instantly share code, notes, and snippets.

@jack2jm
Created June 30, 2021 12:33
Show Gist options
  • Select an option

  • Save jack2jm/cf42d5deeba5f4e424880822761c1573 to your computer and use it in GitHub Desktop.

Select an option

Save jack2jm/cf42d5deeba5f4e424880822761c1573 to your computer and use it in GitHub Desktop.
try {
$result = '';
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'http://54.185.108.244:5000/doAIImageProcessing?img_URL=' . $image_url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
));
$response = curl_exec($curl);
$httpcode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
if ($httpcode == 200) {
$result = $response;
}
} catch (\Exception $e) {}
//dd($result, $httpcode, $image_url);
return $response;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment