- Python Automation Cookbook
- Jaime Buelta
- 99字
- 2025-04-04 16:17:47
Getting ready
To demonstrate how to operate RESTful APIs, we'll use the example site https://jsonplaceholder.typicode.com/. It simulates a common case with posts, comments, and other common resources. We will use posts and comments. The URLs to use will be as follows:
# The collection of all posts
/posts
# A single post. X is the ID of the post
/posts/X
# The comments of post X
/posts/X/comments
The site returns the adequate result to each of them. Pretty handy!
Because it is a test site, data won't be created, but the site will return all the correct responses.