- Start with the Using the Flask framework for RESTful APIs recipe. We'll be adding a new view function to an existing web application.
- Define a route—a URL pattern—to a view function that performs a specific request. This is a decorator, placed immediately in front of the function. It will bind the function to the Flask application:
@dealer.route('/dealer/hands/')
- Define a view function that responds to requests sent to the particular route:
def multi_hand():
- Within the view function, extract the values of a unique key with the get() method or use ordinary [] syntax that is appropriate for the built-in dict type. This returns individual values without the complication of a list for the common case where the list would ...