Member-only story
A Simple Guide of GitHub REST API
When we learn how to use some HTTP clients, such as XMLHttpRequest, Fetch API, Axios, etc. to make HTTP requests, we need a server to handle our HTTP requests.
Usually, we would build a server-side application manually, but there are two disadvantages to doing so:
- It’s too much trouble. Setting up a server-side application is not an easy task, especially for beginners.
- Not easy to share code. The client-side code you write relies on the local server to run, which makes it impossible for someone else to copy your client-side code and run it directly.
To solve this problem, I thought of the GitHub REST API. It is the interface that GitHub provides for developers to access GitHub data, but when we learn to use the HTTP client, we can take advantage of this API, use GitHub as a server, and send requests to this API, so we don’t have to build a server program locally.
GitHub provides detailed documentation for these APIs, but if you’re not going to integrate with GitHub, there’s no need to read the API documentation carefully. So I’ve provided this simple tutorial to help you understand some basic uses.
Send an HTTP request
The basic URL for the GitHub API is:
https://api.github.com/