To understand the components of a REST API with JSON response, we will utilize the Flask web framework, a PostgreSQL/PostGIS database, and SQLAlchemy and GeoAlchemy2 for ORM queries. Flask will be used to create the URL endpoints for the API. PostGIS will store the data in tables defined by SQLAlchemy models, which define the column types for all columns except the geometry columns, which are defined by GeoAlchemy2 column types.
Writing a REST API in Python
REST
REST is a standard for web services, designed to accept requests and parameters and return a representation of that data, usually in a JSON format but sometimes in XML or HTML format. APIs that use REST architecture must meet these architectural constraints:
- ...