Check: APIs

Knowledge check · 5 min · Module 2, lesson 5 of 55 min left in this module

Module 2 · APIsLesson 5 of 5

Goal: Confirm you can read an endpoint and its JSON, pick a status code, and say why localhost only works on your own machine.

Four questions: three on this module, one from Path 1. Every answer explains itself, right or wrong.

An API's reference lists GET /orders/{id}/items. What does GET /orders/58/items return?
Your notes API receives POST /notes with valid JSON, but the text field is an empty string. What should it answer?
You run curl -i on an endpoint and the first line is HTTP/1.1 401 Unauthorized. What do you try first?
From Path 1: your notes API runs on your laptop at http://localhost:3000. A friend on another computer opens http://localhost:3000/notes. What happens?

Retry as often as you like.