1. Go to this page and download the library: Download adaiasmagdiel/cururu library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
adaiasmagdiel / cururu example snippets
daiasMagdiel\Cururu\Cururu;
// Initialize Cururu with optional base URL and headers
$cururu = new Cururu('https://api.example.com', ['Authorization' => 'Bearer your_token']);
// Make a GET request
$response = $cururu->get('/resource');
// Get response content
if ($response->isSuccessful()) {
echo $response->getContent();
} else {
echo "Request failed with status: " . $response->getStatusCode();
}
// Make a POST request with JSON data
$response = $cururu->post('/resource', ['name' => 'Cururu'], ['Content-Type' => 'application/json']);
if ($response->isSuccessful()) {
$json = $response->getJson();
print_r($json);
}
$cururu = new Cururu();
// Make a GET request using the full URL
$response = $cururu->get('https://api.example.com/resource');
$response = $cururu->get('/resource');
// Get status code
$status = $response->getStatusCode();
// Get response content as JSON
$data = $response->getJson();
// Get specific header
$contentType = $response->getHeader('Content-Type');
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.