コンテンツにスキップ
per page, with , order by , clip by
Results of 1 - 10 of about 13 for define (0.001 sec.)
OpenAPI Webhooks 13689
OpenAPI Webhooks Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . There are cases where you want to tell your API users that your app could call their app (sending ... heir system (to their API, their app). This is normally called a webhook . Webhooks steps The process normally is that you define in your code what is the message that you will send, the body of the request . You also define in some way at which moment ... s your app will send those requests or events. And your users define in some way (for example in a web dashboard somewhere) the URL where your app should send those requests. All the logic ab ... however you want to in your own code . Documenting webhooks with FastAPI and OpenAPI With FastAPI , using OpenAPI, you can define the names of these webhooks, the types of HTTP operations that your app can send (e.g. POST , PUT , etc.) and the request ...
https://man.mtool.work/fastapi/0.115/advanced/openapi-webhooks/
HTTPConnection class 10363
HTTPConnection class When you want to define dependencies that should be compatible with both HTTP and WebSockets, you can define a parameter that takes an HTTPConnection instead of a Request or a WebSocket . You can import it from fastapi. ...
https://man.mtool.work/fastapi/0.115/reference/httpconnection/
Request class 10064
Request class You can declare a parameter in a path operation function or dependency to be of type Request and then you can access the raw request object directly, without any validation, etc. You can import it directly from fastapi : from ... fastapi import Request Tip When you want to define dependencies that should be compatible with both HTTP and WebSockets, you can define a parameter that takes an HTTPConnect ...
https://man.mtool.work/fastapi/0.115/reference/request/
Lifespan Events 9308
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 ... hat this code will be executed once , before the application starts receiving requests . The same way, you can define logic (code) that should be executed when the application is shutting down . In this case, this code will be executed once ... led, but only right before the application starts receiving requests, not while the code is being loaded. Lifespan You can define this startup and shutdown logic using the lifespan parameter of the FastAPI app, and a "context manager" (I'll show you wh ... onger be called. It's all lifespan or all events, not both. You can probably skip this part. There's an alternative way to define this logic to be executed during startup and during shutdown . You can define event handlers (functions) that need to be e ...
https://man.mtool.work/fastapi/0.115/advanced/events/
WebSockets 9308
WebSockets When defining WebSockets, you normally declare a parameter of type WebSocket and with it you can read data from the client and send data to it. It is provided directly by Starlette, but you can import it from fastapi : from fasta ... pi import WebSocket Tip When you want to define dependencies that should be compatible with both HTTP and WebSockets, you can define a parameter that takes an HTTPConnect ...
https://man.mtool.work/fastapi/0.115/reference/websockets/
UploadFile class 8551
UploadFile class You can define path operation function parameters to be of the type UploadFile to receive files from the request. You can import it directly from fastapi : from fastapi import UploadFile ::: fastapi.UploadFile options: memb ...
https://man.mtool.work/fastapi/0.115/reference/uploadfile/
Security Tools 8076
Security Tools When you need to declare dependencies with OAuth2 scopes you use Security() . But you still need to define what is the dependable, the callable that you pass as a parameter to Depends() or Security() . There are multiple tool ...
https://man.mtool.work/fastapi/0.115/reference/security/
General - How To - Recipes 7970
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 ... s for Tutorial - Path Operation Configurations - Summary and Description . Documentation Response description - OpenAPI To define the description of the response, shown in the docs UI, read the docs for Tutorial - Path Operation Configurations - Respon ...
https://man.mtool.work/fastapi/0.115/how-to/general/
Request Files 7777
Request Files Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . You can define files to be uploaded by the client using File . Info To receive uploaded files, first ... @app . post ( "/uploadfile/" ) async def create_upload_file ( file : UploadFile ): return { "filename" : file . filename } Define File Parameters Create file parameters the same way you would for Body or Form : Python 3.9+ from typing import Annotated ... mall files. But there are several cases in which you might benefit from using UploadFile . File Parameters with UploadFile Define a file parameter with a type of UploadFile : Python 3.9+ from typing import Annotated from fastapi import FastAPI , File , ...
https://man.mtool.work/fastapi/0.115/tutorial/request-files/
Path Operationの高度な設定 7495
Path Operationの高度な設定 OpenAPI operationId 注意 あなたがOpenAPIの「エキスパート」でなければ、これは必要ないかもしれません。 path operation で operation_id パラメータを利用することで、OpenAPIの operationId を設定できます。 operation_id は ... す。 Python 3.8+ from fastapi import FastAPI app = FastAPI () @app . get ( "/items/" , operation_id = "some_specific_id_you_define" ) async def read_items (): return [{ "item_id" : "Foo" }] path operation関数 の名前をoperationIdとして使用する APIの関数名 ...
https://man.mtool.work/fastapi/0.115/advanced/path-operation-advanced-configurat...
PREV 1 2 NEXT