-
Notifications
You must be signed in to change notification settings - Fork 0
4. Consumindo API com cURL
Isaac Lourenço edited this page Mar 14, 2021
·
1 revision
<?php
$url = "https://busqueifrn.vercel.app/api/alunos/20171114010037";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$aluno = json_decode(curl_exec($ch));Vou pesquisar o por quê do CURLOPT_SSL_VERIFYPEER
<?php
$key = $_ENV["key"];
$url = "https://api.imgbb.com/1/upload?key=$key&image=https://rockcontent.com/br/wp-content/uploads/sites/2/2020/02/teste-de-lideran%C3%A7a.png";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$response = json_decode(curl_exec($ch));
echo $response->data->url;