Using curl for HTTP Requests in PHP


Make GET and POST requests to external APIs using cURL.

Source Code

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://example.com");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments