R

Ravina • 3.96K Points
Extraordinary

Q. Which of these is used to define an endpoint that consumes JSON data?

  • (A) @app.get()
  • (B) @app.consume_json()
  • (C) @app.post() with a Pydantic model in body
  • (D) @json.api()
  • Correct Answer - Option(C)
  • Views: 19
  • Filed under category Fast API
  • Hashtags:

Explanation by: Ravina
To consume JSON, define a POST endpoint and use a Pydantic model as the body parameter.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.