Azure Functions and FastAPI

I’m a huge fan of FastAPI. It’s a high-performance web framework for building APIs in Python, based on type hints and Pydantic, which enables automatic documentation and data validation. At work, we extensively use Azure Functions. These are serverless resources that reduce the need for infrastructure configuration and maintenance, allowing us to focus more on writing code. To create Azure Functions in Python, we can use the azure-functions package. However, I really love FastAPI as a framework for building APIs....

December 14, 2024 · Max Scheijen

HTML Form and JSON for single endpoint in FastAPI

A common challenge when building a FastAPI application is handling different content types, like JSON and Form data. Any many cases your API needs to support both formats, especially when dealing with web forms and modern front-end applications that often send json payloads. This post demonstrates how to build a FastAPI application that handles and validates both JSON and from data inputs on a single endpoint. The Challenge: Handling Different Content Types By default, web browsers use application/x-www-form-urlencoded or multipart/form-data content types when submitting forms....

October 5, 2024 · Max Scheijen