---
source: https://iinventedlight.com/library/notes/fastapi-request-body.md
title: "Request bodies with Pydantic in FastAPI"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "MIT (fastapi/fastapi LICENSE; Copyright (c) 2018 Sebastián Ramírez; https://github.com/fastapi/fastapi/blob/master/LICENSE); prose restates or closely paraphrases cited source lines"
license_family: fastapi-mit
rule_check: "needs rule check (family not in auto-publish rule; check.mjs auto-approves only usgov and arxiv-ccby)"
attribution: "Summary by iinventedlight (AI-assisted). Sources: FastAPI docs, Request Body - FastAPI, MIT (fastapi/fastapi LICENSE; Copyright (c) 2018 Sebastián Ramírez; https://github.com/fastapi/fastapi/blob/master/LICENSE); FastAPI docs, Body - Fields - FastAPI, MIT (fastapi/fastapi LICENSE; Copyright (c) 2018 Sebastián Ramírez; https://github.com/fastapi/fastapi/blob/master/LICENSE)."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-04
status: published
checked_on: 2026-11-04
as_of: 2026-11-04
confidence: medium
untested: "No code was run for this note; only the fetched documentation pages were read."
category: coding-references
topic_area: "code-ai-eng: FastAPI"
tags: ['fastapi', 'pydantic', 'request-body']
sources:
  - id: S1
    title: "Request Body - FastAPI"
    publisher: FastAPI docs
    url: https://fastapi.tiangolo.com/tutorial/body/
    accessed: 2026-11-04
    license: "MIT (fastapi/fastapi LICENSE; Copyright (c) 2018 Sebastián Ramírez; https://github.com/fastapi/fastapi/blob/master/LICENSE)"
  - id: S2
    title: "Body - Fields - FastAPI"
    publisher: FastAPI docs
    url: https://fastapi.tiangolo.com/tutorial/body-fields/
    accessed: 2026-11-04
    license: "MIT (fastapi/fastapi LICENSE; Copyright (c) 2018 Sebastián Ramírez; https://github.com/fastapi/fastapi/blob/master/LICENSE)"
---
# Request bodies with Pydantic in FastAPI

**Answer:** When you need to send data from a client (let's say, a browser) to your API, you send it as a request body. To declare a request body, you use Pydantic models with all their power and benefits. (S1)

## Request vs response

- A response body is the data your API sends to the client. (S1)
- Clients don't necessarily need to send request bodies all the time, sometimes they only request a path, maybe with some query parameters, but don't send a body. (S1)
- Sending a body with a GET request has an undefined behavior in the specifications, nevertheless, it is supported by FastAPI, only for very complex/extreme use cases. (S1)

## Field validation

- You can declare validation and metadata inside of Pydantic models using Pydantic's Field. (S2)
- Field works the same way as Query, Path and Body, it has all the same parameters, etc. (S2)
- Pydantic's Field returns an instance of FieldInfo as well. (S2)

## Claims
- id: C1
  claim: Request bodies are declared with Pydantic models.
  source: S1
  evidence: "To declare a request body, you use Pydantic models with all their power and benefits."
- id: C2
  claim: A GET body is undefined behavior.
  source: S1
  evidence: "Sending a body with a GET request has an undefined behavior in the specifications"
- id: C3
  claim: Field adds validation inside models.
  source: S2
  evidence: "you can declare validation and metadata inside of Pydantic models using Pydantic's Field."
- id: C4
  claim: Field works like Query, Path and Body.
  source: S2
  evidence: "Field works the same way as Query, Path and Body"

## Sources
- [S1] Request Body - FastAPI. FastAPI docs. https://fastapi.tiangolo.com/tutorial/body/ . License: MIT (fastapi/fastapi LICENSE; Copyright (c) 2018 Sebastián Ramírez; https://github.com/fastapi/fastapi/blob/master/LICENSE). Accessed 2026-11-04.
- [S2] Body - Fields - FastAPI. FastAPI docs. https://fastapi.tiangolo.com/tutorial/body-fields/ . License: MIT (fastapi/fastapi LICENSE; Copyright (c) 2018 Sebastián Ramírez; https://github.com/fastapi/fastapi/blob/master/LICENSE). Accessed 2026-11-04.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted).
