REST APIs with Flask (Part 1)

flask-1

Learning Objectives

  • Review API Fundamentals
  • Discuss MVC Architecture and Reinforce Patterns / Best Practices
  • Introduce RESTful Routing
  • Build and Execute GET / POST Requests
  • Introduce and Use Postman to Interact with APIs
  • Discuss the Importance of Serializers
  • Observe How to Properly Set Up Serializers
  • Understand How to Use Serializers to Render Structured Data in API Responses

What-is-an-API(1)

But more specific to our context…

What-is-an-API

Endpoints ARE our interface

api-url

How does this help with MVC?

Working-of-MVC

Does this remind you of React state and rerenders?

MVCTutorial

What and Why of REST

rest-api

The Non-SPA Version

7-restful-routes

The SPA Version of REST

5-restful-routes

Status Codes

Flask-SQLAlchemy One-to-Many

productions cast_members

Anatomy of a Relationship

1-to-many