API Testing Tutorial: GitHub User Info
Learn to test APIs with real code examples.
Getting Started
We'll use GitHub's public API to fetch user information. No authentication required.
Code Example (curl)
curl -s "https://api.github.com/users/octocat" | jq .
Response Analysis
The JSON response contains:
-
login: GitHub username -
id: User ID -
avatar_url: Profile picture URL -
html_url: Profile link
Tips
- Use
-sfor silent mode (no progress bar) - Pipe to
jqfor formatted JSON output - Replace "octocat" with any GitHub username
Conclusion
API testing is essential for developers. This simple example demonstrates real-world usage.
Top comments (0)