PHP code example of maxiwheat / httpful
1. Go to this page and download the library: Download maxiwheat/httpful 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/ */
maxiwheat / httpful example snippets
// Make a request to the GitHub API with a custom
// header of "X-Trvial-Header: Just as a demo".
$url = "https://api.github.com/users/maxiwheat";
$response = src\Request::get($url)
->expectsJson()
->withXTrivialHeader('Just as a demo')
->send();
echo "{$response->body->name} joined GitHub on " .
date('M jS', strtotime($response->body->created_at)) ."\n";