Build beautifully documented APIs with Python’s relatively new backend framework called FastAPI. FastAPI lets you create very fast and well documented APIs with minimal code.
We go over most topics that you will need to know about when writing APIs using this framework. Namely, writing simple GET and POST endpoints, how to get automatic documentations & data validations, how to support query parameters, path parameters and request bodies, how to automatically validate your request inputs.
We will also look at slightly advanced use cases, such as, reading cookies and request headers, returning custom status codes and exceptions with helpful messages, kicking off asynchronous background tasks and supporting CORS for all or some of your origins.
Timestamps:
0:00 Intro & Demo
02:14 Create Basic FastAPI Endpoint
05:52 Path Parameters
07:32 Automatic Documentation
08:38 Query Parameters
10:13 Optional Parameters
11:24 Enumeration & Automatic Data Validation
17:49 POST Endpoint
18:50 Request Body
21:23 Typed Responses
23:15 Status Codes
24:54 HTTP Exceptions with Custom Message
27:32 Cookies & Request Headers
35:22 Better Documentation
40:38 Background Tasks
46:15 Cross Origin Requests (CORS)
51:00 Summary & Outro
Amazing Documentation: [https://fastapi.tiangolo.com](https://fastapi.tiangolo.com/)
Code in the video: [https://github.com/irtiza07/python-fa...](https://github.com/irtiza07/python-fa...)
#python #fastapi #backendDevelopment #tutorial #apiDevelopment #documentation
Visit me at: https://irtizahafiz.com
Contact me at: [email protected]