コンテンツにスキップ
per page, with , order by , clip by
Results of 1 - 5 of about 5 for integer (0.004 sec.)
Status Codes 11931
Status Codes You can import the status module from fastapi : from fastapi import status status is provided directly by Starlette. It contains a group of named constants (variables) with integer status codes. For example: 200: status.HTTP_20 ... kly access HTTP (and WebSocket) status codes in your app, using autocompletion for the name without having to remember the integer status codes by memory. Read more about it in the FastAPI docs about Response Status Code . Example from fastapi import Fa ...
https://man.mtool.work/fastapi/0.115/reference/status/
エラーハンドリング 10681
エラーハンドリング APIを使用しているクライアントにエラーを通知する必要がある状況はたくさんあります。 このクライアントは、フロントエンドを持つブラウザ、誰かのコード、IoTデバイスなどが考えられます。 クライアントに以下のようなことを伝える必要が ... ォルトのJSONエラーの代わりに以下が返されます: { "detail" : [ { "loc" : [ "path" , "item_id" ], "msg" : "value is not a valid integer" , "type" : "type_error.integer" } ] } 以下のようなテキスト版を取得します: 1 validation error path -> item_id value is not ... a valid integer (type=type_error.integer) RequestValidationError と ValidationError 注意 これらは今のあなたにとって重要でない場合は省略して ... が無効であることを示すレスポンスが表示されます: { "detail" : [ { "loc" : [ "body" , "size" ], "msg" : "value is not a valid integer" , "type" : "type_error.integer" } ], "body" : { "title" : "towel" , "size" : "XL" } } FastAPIの HTTPException とStarlette ...
https://man.mtool.work/fastapi/0.115/tutorial/handling-errors/
Advanced Middleware 8181
Advanced Middleware Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . In the main tutorial you read how to add Custom Middleware to your application. And then you al ... that are smaller than this minimum size in bytes. Defaults to 500 . compresslevel - Used during GZip compression. It is an integer ranging from 1 to 9. Defaults to 9 . Lower value results in faster compression but larger file sizes, while higher value r ...
https://man.mtool.work/fastapi/0.115/advanced/middleware/
パスパラメータ 8181
パスパラメータ Pythonのformat文字列と同様のシンタックスで「パスパラメータ」や「パス変数」を宣言できます: Python 3.8+ from fastapi import FastAPI app = FastAPI () @app . get ( "/items/ {item_id} " ) async def read_item ( item_id ): return { ... foo を開くと、次のHTTPエラーが表示されます: { "detail" : [ { "loc" : [ "path" , "item_id" ], "msg" : "value is not a valid integer" , "type" : "type_error.integer" } ] } これは、パスパラメータ item_id が int ではない値 "foo" だからです。 http://127.0.0. ...
https://man.mtool.work/fastapi/0.115/tutorial/path-params/
SQL (Relational) Databases 6931
SQL (Relational) Databases Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . FastAPI doesn't require you to use a SQL (relational) database. But you can use any data ... QL primary keys in the SQLModel docs). By having the type as int | None , SQLModel will know that this column should be an INTEGER in the SQL database and that it should be NULLABLE . Field(index=True) tells SQLModel that it should create a SQL index fo ...
https://man.mtool.work/fastapi/0.115/tutorial/sql-databases/
PREV 1 NEXT