FastAPI: How to Change the Response Status Code
FastAPI, as its name implies, is a fast, modern, and high-performance web framework for building backend APIs with Python. The response status code is a three-digit number that…
How to Model Reponses in FastAPI (3 Examples)
The Fundamentals FastAPI is a fast-growing Python web framework that can help you build high-performance backend projects. One of the features of the web framework is that it…
FastAPI: How to Create a Custom 404 (Not Found) Route
404 is an HTTP status code that indicates that a server couldn’t find the resource requested by a client (such as a web browser or API client). FastAPI…
FastAPI AttributeError: ‘dict’ object has no attribute ‘encode’
This concise, straight-to-the-point article will walk you through a couple of different solutions to fix a common error you might encounter when working with FastAPI. The Problem Here…
2 Ways to Implement Pagination in FastAPI
Introduction Pagination is a process of dividing a large amount of data into smaller chunks. It is important because it can improve the performance, usability, and security of…
FastAPI: Render HTML Templates with Dynamic Content
Overview FastAPI is often used to develop backend APIs. However, you can also use this web framework to render HTML templates and create websites with the help of…
FastAPI: How to Return a TXT or JSON File
This concise, practical article shows you how to return a TXT or a JSON file in FastAPI. I assume you already have some understanding of the web framework,…
FastAPI: How to extract request headers (2 approaches)
This concise, practical article will walk you through a couple of different ways to extract headers from an incoming request in FastAPI. What are HTTP headers? Headers are…
3 Ways to Get User’s IP Address in FastAPI
When building backend applications with FastAPI, you may need to get the IP addresses of your users for several purposes, such as: This quick article shows you a…
How to Return a CSV File in FastAPI
CSV stands for Comma Separated Values. It is a plain text file that stores data by delimiting data entries with commas. CSV files are popular in Python apps…
« Previous 1 2 3 4 Next »