Results of 1 - 4 of about 4 for Tenders (0.001 sec.)
- 追加のステータスコード 12279
- 追加のステータスコード デフォルトでは、 FastAPI は JSONResponse を使ってレスポンスを返します。その JSONResponse の中には、 path operation が返した内容が入ります。 それは、デフォルトのステータスコードか、 path operation でセットしたものを利用
...responses import JSONResponse app = FastAPI () items = { "foo" : { "name" : "Fighters" , "size" : 6 }, "bar" : { "name" : "Tenders" , "size" : 3 }} @app . put ( "/items/ {item_id} " ) async def upsert_item ( item_id : str , name : Union [ str , None ] =...responses import JSONResponse app = FastAPI () items = { "foo" : { "name" : "Fighters" , "size" : 6 }, "bar" : { "name" : "Tenders" , "size" : 3 }} @app . put ( "/items/ {item_id} " ) async def upsert_item ( item_id : str , name : Annotated [ str | None...responses import JSONResponse app = FastAPI () items = { "foo" : { "name" : "Fighters" , "size" : 6 }, "bar" : { "name" : "Tenders" , "size" : 3 }} @app . put ( "/items/ {item_id} " ) async def upsert_item ( item_id : str , name : Annotated [ Union [ st... - https://man.mtool.work/fastapi/0.115/advanced/additional-status-codes/
- Testing Events: startup - shutdown 9190
- Testing Events: startup - shutdown Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . When you need your event handlers ( startup and shutdown ) to run in your tests,
...on_event ( "startup" ) async def startup_event (): items [ "foo" ] = { "name" : "Fighters" } items [ "bar" ] = { "name" : "Tenders" } @app . get ( "/items/ {item_id} " ) async def read_items ( item_id : str ): return items [ item_id ] def test_read_item... - https://man.mtool.work/fastapi/0.115/advanced/testing-events/
- Additional Responses in OpenAPI 7748
- Additional Responses in OpenAPI Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . Warning This is a rather advanced topic. If you are starting with FastAPI , you mig
...scription" : "Item requested by ID" , "content" : { "application/json" : { "example" : { "id" : "bar" , "value" : "The bar tenders" } } }, }, }, ) async def read_item ( item_id : str ): if item_id == "foo" : return { "id" : "foo" , "value" : "there goes... - https://man.mtool.work/fastapi/0.115/advanced/additional-responses/
- Lifespan Events 7748
- Lifespan Events Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . You can define logic (code) that should be executed before the application starts up . This means t
...on_event ( "startup" ) async def startup_event (): items [ "foo" ] = { "name" : "Fighters" } items [ "bar" ] = { "name" : "Tenders" } @app . get ( "/items/ {item_id} " ) async def read_items ( item_id : str ): return items [ item_id ] In this case, the... - https://man.mtool.work/fastapi/0.115/advanced/events/
PREV
1
NEXT