Request Body

noun

say it: “rih-KWEST BOD-ee” /rɪˈkwɛst ˈbɒdi/

The data a client sends with a request, usually JSON with POST or PUT, such as a new board game's title and player count.

What is Request Body?

A request body is the JSON a client sends, usually with POST or PUT. Declare a Pydantic model parameter and FastAPI reads, checks and converts it.

@app.post('/recipes')
def create_recipe(recipe: RecipeIn):
    return save_recipe(recipe)

In a sentence

  • “A GET request has no request body; its details go in the path and the query.”
  • “The request body held the game's title, min_players and max_players.”

Level: Apprentice · More FastAPI terms at this level

Updated

In other subjects