Creating a RESTful API with FastAPI
In the last chapter, we learned about a framework called Flask. Flask represents Python in a landscape of traditional web development frameworks designed to generate content on the server and send it back to the browser. This is how we have developed web applications for decades. The 2010s brought a paradigm shift, but it didn’t happen overnight.
In 2004, the term AJAX, an acronym for Asynchronous JavaScript and XML, was coined by Jesse James Garrett in an article titled Ajax: A New Approach to Web Applications. This article helped popularize the concept and techniques of asynchronous web applications. By 2005, mainstream browsers all supported a new XMLHttpRequest (XHR) web API call. The feature allowed a developer to request pure data instead of a generated HTML page with the data integrated with markup.
The rise of single-page applications (SPAs) in the 2010s was closely associated with the advancement of JavaScript frameworks such...