Results of 1 - 10 of about 14 for actually (0.008 sec.)
- OpenAPI Webhooks 14686
- 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 an...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 y...ou are actually not declaring a path (like /items/ ), the text you pass there is just an identifier of the webhook (the name of the event)... - https://man.mtool.work/fastapi/0.115/advanced/openapi-webhooks/
- Using the Request Directly 9680
- Using the Request Directly Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . Up to now, you have been declaring the parts of the request that you need with their typ
...are situations where you might need to access the Request object directly. Details about the Request object As FastAPI is actually Starlette underneath, with a layer of several tools on top, you can use Starlette's Request object directly when you need... - https://man.mtool.work/fastapi/0.115/advanced/using-request-directly/
- Advanced Middleware 9085
- 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
...n import UnicornMiddleware app = SomeASGIApp () new_app = UnicornMiddleware ( app , some_config = "rainbow" ) But FastAPI (actually Starlette) provides a simpler way to do it that makes sure that the internal middlewares handle server errors and custom e... - https://man.mtool.work/fastapi/0.115/advanced/middleware/
- Using Dataclasses 8787
- 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
...me: data validation data serialization data documentation, etc. This works the same way as with Pydantic models. And it is actually achieved in the same way underneath, using Pydantic. Info Keep in mind that dataclasses can't do everything Pydantic model... - https://man.mtool.work/fastapi/0.115/advanced/dataclasses/
- Simple OAuth2 with Password and Bearer 8787
- 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 to...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 need...rn a WWW-Authenticate header. In the case of bearer tokens (our case), the value of that header should be Bearer . You can actually skip that extra header and it would still work. But it's provided here to be compliant with the specifications. Also, ther... - https://man.mtool.work/fastapi/0.115/tutorial/security/simple-oauth2/
- Bigger Applications - Multiple Files 8489
- Bigger Applications - Multiple Files Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . If you are building an application or a web API, it's rarely the case that you
...to the main FastAPI application. It will include all the routes from that router as part of it. Technical Details It will actually internally create a path operation for each path operation that was declared in the APIRouter . So, behind the scenes, it...will actually work as if everything was the same single app. Check You don't have to worry about performance when including routers. Thi... - https://man.mtool.work/fastapi/0.115/tutorial/bigger-applications/
- Development - Contributing 8192
- 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
...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/
- Behind a Proxy 7894
- Behind a Proxy Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . In some situations, you might need to use a proxy server like Traefik or Nginx with a configuration
...(the proxy) that would put your FastAPI application under a path like /api/v1 . In this case, the original path /app would actually be served at /api/v1/app . Even though all your code is written assuming there's just /app . Python 3.8+ from fastapi impo... - https://man.mtool.work/fastapi/0.115/advanced/behind-a-proxy/
- OpenAPI Callbacks 7894
- 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
...reated above. Now use the parameter callbacks in your API's path operation decorator to pass the attribute .routes (that's actually just a list of routes/ path operations ) from that callback router: Python 3.8+ from typing import Union from fastapi impo... - https://man.mtool.work/fastapi/0.115/advanced/openapi-callbacks/
- HTTP Basic Auth 7894
- 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
...help" of our application, just using the time taken to answer. Fix it with secrets.compare_digest() But in our code we are actually using secrets.compare_digest() . In short, it will take the same time to compare stanleyjobsox to stanleyjobson than it ta... - https://man.mtool.work/fastapi/0.115/advanced/security/http-basic-auth/