# Answers and Bodies

Answers and Bodies: When It Isn't There: HTTPException and 404, Taking JSON In: Your First Request Body.

Updated: November 19, 2026

1. [When It Isn't There: HTTPException and 404](https://www.ask-codey.com/lessons/fastapi-not-found-httpexception) (Apprentice): A FastAPI route answers 404 for an item that isn't there by raising HTTPException with a status code and a detail message, which stops the function at once and sends {"detail": ...}, and a route that creates something sets status_code=201 on its decorator.
2. [Taking JSON In: Your First Request Body](https://www.ask-codey.com/lessons/fastapi-first-request-body) (Apprentice): A POST route takes the JSON a request sends in its body through a small Pydantic model, a class that names each field and its type, then turns it into a dictionary with model_dump(), gives the new item the next id, and answers 201 with it.

Source: https://www.ask-codey.com/courses/python-web-apis/topics/fastapi-answers-and-bodies
