What does this program print?

from FastAPI
FastAPI 0.141.1 / Python 3.14 beginner 2 min

What does this program print?

Python
from fastapi import FastAPI
from fastapi.testclient import TestClient

app = FastAPI()

@app.get("/items/{item_id}")
def read_item(item_id: int, active: bool = False):
    return {"item_id": item_id, "active": active}

response = TestClient(app).get("/items/9?active=true")
print(response.status_code, response.json())
Open in playground
Report an error