# Routing by Hand, and Why Frameworks Exist

A plain Python function can answer requests by checking each one's method and path with if statements and returning a status code and a body, and seeing that code grow with every route shows the jobs a framework such as FastAPI takes over.

![Cheat sheet: Routing by Hand, and Why Frameworks Exist](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/fd59f1027f71485fa712cbc0946c1f3c.webp)

- Category: FastAPI
- Level: Apprentice
- Tags: 405 Method Not Allowed, Endpoint (rest-api), fastapi, Framework, python, rest-api, Routing, web-development
- Author: Gregor Dzierzon
- Updated: November 23, 2026

Source: https://www.ask-codey.com/cheat-sheets/fastapi-http-routing-by-hand-cheat-sheet
