コンテンツにスキップ
per page, with , order by , clip by
Results of 1 - 8 of about 8 for actual (0.005 sec.)
Test Client - TestClient 12417
Test Client - TestClient You can use the TestClient class to test FastAPI applications without creating an actual HTTP and socket connection, just communicating directly with the FastAPI code. Read more about it in the FastAPI docs for Test ...
https://man.mtool.work/fastapi/0.115/reference/testclient/
OpenAPI Callbacks 11133
OpenAPI Callbacks Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . You could create an API with a path operation that could trigger a request to an external API cre ... k_router.routes as an argument to the path operation decorator . We'll see what that is next. Documenting the callback The actual callback code will depend heavily on your own API app. And it will probably vary a lot from one app to the next. It could ... is example doesn't implement the callback itself (that could be just a line of code), only the documentation part. Tip The actual callback is just an HTTP request. When implementing the callback yourself, you could use something like HTTPX or Requests ... urn { "msg" : "Invoice received" } There are 2 main differences from a normal path operation : It doesn't need to have any actual code, because your app will never call this code. It's only used to document the external API . So, the function could jus ...
https://man.mtool.work/fastapi/0.115/advanced/openapi-callbacks/
OpenAPI Webhooks 9543
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 ... e URL where your app should send those requests. All the logic about how to register the URLs for webhooks and the code to actually send those requests is up to you. You write it however you want to in your own code . Documenting webhooks with FastAPI ... The webhooks that you define will end up in the OpenAPI schema and the automatic docs UI . Info The app.webhooks object is actually just an APIRouter , the same type you would use when structuring your app with multiple files. Notice that with webhooks ... you are actually not declaring a path (like /items/ ), the text you pass there is just an identifier of the webhook (the name of the even ...
https://man.mtool.work/fastapi/0.115/advanced/openapi-webhooks/
Request Files 8910
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 ... at inherits directly from Form . But remember that when you import Query , Path , File and others from fastapi , those are actually functions that return special classes. Tip To declare File bodies, you need to use File , because otherwise the paramete ... t consuming all the memory. You can get metadata from the uploaded file. It has a file-like async interface. It exposes an actual Python SpooledTemporaryFile object that you can pass directly to other libraries that expect a file-like object. UploadFil ... content type (MIME type / media type) (e.g. image/jpeg ). file : A SpooledTemporaryFile (a file-like object). This is the actual Python file object that you can pass directly to other functions or libraries that expect a "file-like" object. UploadFile ...
https://man.mtool.work/fastapi/0.115/tutorial/request-files/
Development - Contributing 8278
Development - Contributing Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . First, you might want to see the basic ways to help FastAPI and get help . Developing If ... at in the directory ./docs/en/ . Many of the tutorials have blocks of code. In most of the cases, these blocks of code are actual complete applications that can be run as is. In fact, those blocks of code are not written inside the Markdown, they are P ... d those Python files are included/injected in the documentation when generating the site. Docs for tests Most of the tests actually run against the example source files in the documentation. This helps to make sure that: The documentation is up-to-date ...
https://man.mtool.work/fastapi/0.115/contributing/
Repository Management Tasks 7952
Repository Management Tasks These are the tasks that can be performed to manage the FastAPI repository by team members . Tip This section is useful only to a handful of people, team members with permissions to manage the repository. You can ... in an unexpected way that is not supported, but they considered it what should be supported by default. Many of these are actually features or refactors. But in some cases there's an actual bug. refactor : Refactors This is normally for changes to the ...
https://man.mtool.work/fastapi/0.115/management-tasks/
Simple OAuth2 with Password and Bearer 6994
Simple OAuth2 with Password and Bearer Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . Now let's build from the previous chapter and add the missing parts to have ... pec also says that the client can send another form field " scope ". The form field name is scope (in singular), but it is actually a long string with "scopes" separated by spaces. Each "scope" is just a string (without spaces). They are normally used ... ptional scope field as a big string, composed of strings separated by spaces. An optional grant_type . Tip The OAuth2 spec actually requires a field grant_type with a fixed value of password , but OAuth2PasswordRequestForm doesn't enforce it. If you ne ... won't have an attribute scope with the long string separated by spaces, instead, it will have a scopes attribute with the actual list of strings for each scope sent. We are not using scopes in this example, but the functionality is there if you need i ...
https://man.mtool.work/fastapi/0.115/tutorial/security/simple-oauth2/
SQL (Relational) Databases 6994
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 ... o ) session . commit () return { "ok" : True } The Hero class is very similar to a Pydantic model (in fact, underneath, it actually is a Pydantic model ). There are a few differences: table=True tells SQLModel that this is a table model , it should rep ... be a SQL column of type TEXT (or VARCHAR , depending on the database). Create an Engine A SQLModel engine (underneath it's actually a SQLAlchemy engine ) is what holds the connections to the database. You would have one single engine object for all you ... 't worry, with the way the code is structured, we'll make sure we use a single SQLModel session per request later, this is actually what the check_same_thread is trying to achieve. Create the Tables We then add a function that uses SQLModel.metadata.cr ...
https://man.mtool.work/fastapi/0.115/tutorial/sql-databases/
PREV 1 NEXT