This content originally appeared on DEV Community and was authored by Sarvesh Kesharwani
Path parameters are part of the URL path and are required.
Example: /get_patient_data/1
— here, 1 is a path parameter.
Query parameters come after the ? in the URL and are **optional **by default.
Example: /sorted_patient_list?sort_by=asc
— here, sort_by=asc is a query parameter.
This content originally appeared on DEV Community and was authored by Sarvesh Kesharwani
Sarvesh Kesharwani | Sciencx (2025-06-07T15:39:11+00:00) Whats the difference b/w Path and Query in FastAPI?. Retrieved from https://www.scien.cx/2025/06/07/whats-the-difference-b-w-path-and-query-in-fastapi/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.