Computer scienceBackendFlaskApplication Architecture

Designing REST API

Adding second responses

Report a typo

In this task, let's make sure that the returned result is in JSON format.

Variable updated_book_data stores a dict-like object that needs to be returned in RESTful JSON format

Write a program in Python 3
@app.route("/books/<book_id>", methods=["PUT"])
def change_book(book_id: int):
updated_book_data = internal_database_request(book_id, request.json)

# Fill out missing part
return ...
___

Create a free account to access the full topic