Forked from jack2jm/Curl GET - PHP Request - Example Code
Created
February 12, 2024 05:52
-
-
Save Bhavya8181/846dee45006d56f930154a389d7e424d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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