This course will be retired on June 1, 2025.
Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Start a free Courses trial
to watch this video
We'll set up the first feature of our GitHub client: the ability to search repositories. We'll use the wrapper library to pass our search parameter to GitHub, then use the results to display a list in our application.
GitHub API Documentation for Search
HTTP Basics: Sending Data with a GET Request
Github API Easy Access Library Basic usage
The head of the library is the Milo\Github\Api class. Within this class you access the API by GET, POST, HEAD, PUT ... HTTP methods.
$api = new Milo\Github\Api;
# Get all available emoticon URLs example
$response = $api->get('/emojis');
$emojis = $api->decode($response);
# Render a Markdown document example
$data = [
'text' => 'Check out this commit e41d17e4a4a9e5368e018fcac44ff42155bc8738',
'mode' => 'gfm',
'context' => 'milo/github-api',
];
$response = $api->post('/markdown', $data);
$html = $api->decode($response);
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up