这段程序会输出什么?

来自 FastAPI
FastAPI 0.141.1 / Python 3.14 入门 2分钟

这段程序会输出什么?

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())
在试验场中打开
报告错误