Molten Framework: Advanced Features


Overview/Description
Expected Duration
Lesson Objectives
Course Number
Expertise Level



Overview/Description
This course covers the use of features in the Molten framework to make your HTTP APIs meaningful and easy to use and test. You'll begin by connecting your Molten application to a SQLite database, including the creation of a cursor to work with the database. You'll then wire up your app so that all the data sent in using POST requests to a specific route is written out to the database. You'll also define handlers for GET requests for that same data by reading from the database. Next, you'll then look at adding middleware into your app and set this middleware to check request headers for the authorization to invoke requests. You'll also tweak the middleware to distinguish between certain types of requests so that authorization is only required for some of them. You'll also see how you can dynamically generate documentation for your Molten application using the OpenAPIHandler. You'll explore how you can use the OpenAPIUIHandler to produce a Swagger UI, which can be used by developers to test the application and also by users to figure out exactly how to use your APIs. Finally, you'll learn how you can serve images to clients using Molten, including attaching a local file to a Response object and returning it to the client.

Expected Duration (hours)
1.4

Lesson Objectives

Molten Framework: Advanced Features

  • discover the key concepts covered in this course
  • connect to a SQLite database using the python sqlite3 library and define SQL queries to run against that database from your Molten app
  • wire up your Molten application so that the data passed in through POST requests is written out to a SQLite database
  • read data from a database when a GET request is submitted to your Molten app
  • add a middleware layer into your app to verify authorization information in HTTP request headers
  • define a middleware layer which distinguishes between requests when checking for authorization
  • create an OpenAPIHandler instance which dynamically generates documentation for your Molten application
  • use the OpenAPIUIHandler class to generate a Swagger UI for your Molten application
  • use Molten's HTTPSecurityScheme to enable the use of authorization from the Swagger UI
  • build a Molten application which returns an HTTP Response containing binary data
  • summarize the key concepts covered in this course
  • Course Number:
    it_pyhtamdj_02_enus

    Expertise Level
    Intermediate