コンテンツにスキップ
per page, with , order by , clip by
Results of 1 - 10 of about 12 for convert (0.002 sec.)
ヘッダーのパラメータ 12912
ヘッダーのパラメータ ヘッダーのパラメータは、 Query や Path 、 Cookie のパラメータを定義するのと同じように定義できます。 Header をインポート まず、 Header をインポートします: Python 3.8+ - non-Annotated from typing import Union from fastapi ... 使用することができます。 もしなんらかの理由でアンダースコアからハイフンへの自動変換を無効にする必要がある場合は、 Header の convert_underscores に False を設定してください: Python 3.8+ - non-Annotated from typing import Union from fastapi import FastAPI ... stAPI () @app . get ( "/items/" ) async def read_items ( strange_header : Union [ str , None ] = Header ( default = None , convert_underscores = False ), ): return { "strange_header" : strange_header } ? Other versions and variants Python 3.10+ Python 3 ... Header app = FastAPI () @app . get ( "/items/" ) async def read_items ( strange_header : Annotated [ str | None , Header ( convert_underscores = False )] = None , ): return { "strange_header" : strange_header } from typing import Annotated , Union from ...
https://man.mtool.work/fastapi/0.115/tutorial/header-params/
General - How To - Recipes 11161
General - How To - Recipes Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . Here are several pointers to other places in the docs, for general or frequent questions ... a path operation , and show it in the docs UI, read the docs for Tutorial - Path Operation Configurations - Deprecation . Convert any Data to JSON-compatible To convert any data to JSON-compatible, read the docs for Tutorial - JSON Compatible Encoder . ...
https://man.mtool.work/fastapi/0.115/how-to/general/
Response - Change Status Code 10630
Response - Change Status Code Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . You probably read before that you can set a default Response Status Code . But in som ... xist, you want to create it, and return an HTTP status code of "CREATED" 201 . But you still want to be able to filter and convert the data you return with a response_model . For those cases, you can use a Response parameter. Use a Response parameter Yo ... ormally would (a dict , a database model, etc). And if you declared a response_model , it will still be used to filter and convert the object you returned. FastAPI will use that temporal response to extract the status code (also cookies and headers), an ...
https://man.mtool.work/fastapi/0.115/advanced/response-change-status-code/
Using Dataclasses 9409
Using Dataclasses Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . FastAPI is built on top of Pydantic , and I have been showing you how to use Pydantic models to d ... support for dataclasses . So, even with the code above that doesn't use Pydantic explicitly, FastAPI is using Pydantic to convert those standard dataclasses to Pydantic's own flavor of dataclasses. And of course, it supports the same: data validation d ... 9 , "description" : "A place to be playin' and havin' fun" , "tags" : [ "breater" ], } The dataclass will be automatically converted to a Pydantic dataclass. This way, its schema will show up in the API docs user interface: Dataclasses in Nested Data St ... ut a list of dictionaries with internal data. FastAPI will use the response_model parameter (that includes dataclasses) to convert the response. You can combine dataclasses with other type annotations in many different combinations to form complex data ...
https://man.mtool.work/fastapi/0.115/advanced/dataclasses/
Response Headers 8702
Response Headers Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . Use a Response parameter You can declare a parameter of type Response in your path operation funct ... ormally would (a dict , a database model, etc). And if you declared a response_model , it will still be used to filter and convert the object you returned. FastAPI will use that temporal response to extract the headers (also cookies and status code), an ...
https://man.mtool.work/fastapi/0.115/advanced/response-headers/
Response Cookies 8525
Response Cookies Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . Use a Response parameter You can declare a parameter of type Response in your path operation funct ... ormally would (a dict , a database model, etc). And if you declared a response_model , it will still be used to filter and convert the object you returned. FastAPI will use that temporal response to extract the cookies (also headers and status code), an ...
https://man.mtool.work/fastapi/0.115/advanced/response-cookies/
Custom Request and APIRoute class 7835
Custom Request and APIRoute class Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . In some cases, you may want to override the logic used by the Request and APIRout ... ced" feature. If you are just starting with FastAPI you might want to skip this section. Use cases Some use cases include: Converting non-JSON request bodies to JSON (e.g. msgpack ). Decompressing gzip-compressed request bodies. Automatically logging al ... tarlette's docs about Requests . The only thing the function returned by GzipRequest.get_route_handler does differently is convert the Request to a GzipRequest . Doing this, our GzipRequest will take care of decompressing the data (if necessary) before ...
https://man.mtool.work/fastapi/0.115/how-to/custom-request-and-route/
HTTP Basic Auth 7658
HTTP Basic Auth Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . For the simplest cases, you can use HTTP Basic Auth. In HTTP Basic Auth, the application expects a ... ers (the ones in English), this means it wouldn't work with characters like á , as in Sebastián . To handle that, we first convert the username and password to bytes encoding them with UTF-8. Then we can use secrets.compare_digest() to ensure that crede ...
https://man.mtool.work/fastapi/0.115/advanced/security/http-basic-auth/
Settings and Environment Variables 7481
Settings and Environment Variables Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . In many cases your application could need some external settings or configuratio ... n a case-insensitive way, so, an upper-case variable APP_NAME will still be read for the attribute app_name . Next it will convert and validate the data. So, when you use that settings object, you will have data of the types you declared (e.g. items_per ...
https://man.mtool.work/fastapi/0.115/advanced/settings/
FastAPI 7481
FastAPI FastAPI framework, high performance, easy to learn, fast to code, ready for production ドキュメント : https://fastapi.tiangolo.com ソースコード : https://github.com/fastapi/fastapi FastAPI は、Pythonの標準である型ヒントに基づいてPyt ... クッキー ヘッダー フォーム ファイル 出力データの 変換 : Python のデータや型からネットワークデータへ変換します (JSON として): Convert Python types ( str , int , float , bool , list , etc). datetime オブジェクト UUID オブジェクト データベースモデル ...などな ...
https://man.mtool.work/fastapi/0.115/
PREV 1 2 NEXT