Figure 1- The result of API at
http://localhost:9999/tutorials (using method GET)
1.2. (1.5 points)
The API at url:
http://localhost:9999/tutorials/:id/comments (:id - is an ObjectId of the Tutorial)return information of all comments by Id of the tutorial in database, using GET method.
See Figure 2 for more detail.
GET
http://localhost:9999/tutorials/652c1cd546a765d027fb163c/comments
Params Auth
Body
Pretty Raw Preview Visualize JSON
1
2
345
4
6
7
8
9
10
11
12
13
{
Cookies
Headers (6) Body Pre-req. Tests
Settings
Send
200 OK 25 ms 824 B Save as example
Q
"id": "652cc6cd83c0aab446fd6a06",
"username": "Tom Cruise",
"text": "Hi, everyone!",
"createAt": "2023-10-16T05:14:53.257Z"
},
{
"_id": "652cc74483c0aab446fd6a09",
"
"username": "Scarlett Johansson",
text": "Perfect self-study topic. Thank you!",
"createAt": "2023-10-16T05:16:52.418Z"
},
Zoom
+ 100%
Close