- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 97 for received (0.14 sec)
-
docs_src/generate_clients/tutorial002.py
class User(BaseModel): username: str email: str @app.post("/items/", response_model=ResponseMessage, tags=["items"]) async def create_item(item: Item): return {"message": "Item received"} @app.get("/items/", response_model=List[Item], tags=["items"]) async def get_items(): return [ {"name": "Plumbus", "price": 3}, {"name": "Portal Gun", "price": 9001}, ]
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Mar 04 22:02:18 GMT 2022 - 755 bytes - Viewed (0) -
docs_src/generate_clients/tutorial001.py
name: str price: float class ResponseMessage(BaseModel): message: str @app.post("/items/", response_model=ResponseMessage) async def create_item(item: Item): return {"message": "item received"} @app.get("/items/", response_model=List[Item]) async def get_items(): return [ {"name": "Plumbus", "price": 3}, {"name": "Portal Gun", "price": 9001},
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Mar 04 22:02:18 GMT 2022 - 519 bytes - Viewed (0) -
docs/en/docs/tutorial/path-params.md
```JSON {"item_id":3} ``` !!! check Notice that the value your function received (and returned) is `3`, as a Python `int`, not a string `"3"`.
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Mar 22 01:42:11 GMT 2024 - 9.1K bytes - Viewed (0) -
docs/en/docs/advanced/generate-clients.md
### API Docs If you go to the API docs, you will see that it has the **schemas** for the data to be sent in requests and received in responses: <img src="/img/tutorial/generate-clients/image01.png"> You can see those schemas because they were declared with the models in the app.
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:53:19 GMT 2024 - 10.5K bytes - Viewed (0) -
docs/en/docs/tutorial/first-steps.md
In that case, it would mean the JSON attributes, and data types they have, etc. #### OpenAPI and JSON Schema OpenAPI defines an API schema for your API. And that schema includes definitions (or "schemas") of the data sent and received by your API using **JSON Schema**, the standard for JSON data schemas. #### Check the `openapi.json`
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu May 02 22:37:31 GMT 2024 - 12K bytes - Viewed (0) -
docs_src/openapi_callbacks/tutorial001.py
external API with the notification of the invoice event (e.g. "payment successful"). """ # Send the invoice, collect the money, send the notification (the callback)
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat May 14 11:59:59 GMT 2022 - 1.3K bytes - Viewed (0) -
docs/en/docs/tutorial/middleware.md
## Create a middleware To create a middleware you use the decorator `@app.middleware("http")` on top of a function. The middleware function receives: * The `request`. * A function `call_next` that will receive the `request` as a parameter. * This function will pass the `request` to the corresponding *path operation*. * Then it returns the `response` generated by the corresponding *path operation*.
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Jan 11 16:31:18 GMT 2024 - 2.9K bytes - Viewed (0) -
docs/en/docs/advanced/middleware.md
```Python from fastapi import FastAPI from unicorn import UnicornMiddleware app = FastAPI() app.add_middleware(UnicornMiddleware, some_config="rainbow") ``` `app.add_middleware()` receives a middleware class as the first argument and any additional arguments to be passed to the middleware. ## Integrated middlewares **FastAPI** includes several middlewares for common use cases, we'll see next how to use them.
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Mar 10 18:27:10 GMT 2023 - 4K bytes - Viewed (0) -
docs/en/docs/tutorial/security/oauth2-jwt.md
```Python hl_lines="6 12-14 28-30 78-86" {!> ../../../docs_src/security/tutorial004.py!} ``` ## Update the dependencies Update `get_current_user` to receive the same token as before, but this time, using JWT tokens. Decode the received token, verify it, and return the current user. If the token is invalid, return an HTTP error right away. === "Python 3.10+" ```Python hl_lines="89-106"
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:53:19 GMT 2024 - 13K bytes - Viewed (0) -
tests/test_tutorial/test_websockets/test_tutorial002_py310.py
assert data == "Session cookie or query token value is: some-token" data = websocket.receive_text() assert data == f"Message text was: {message}, for item ID: bar" message = "Message two" websocket.send_text(message) data = websocket.receive_text() assert data == "Session cookie or query token value is: some-token" data = websocket.receive_text()
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Sat Mar 18 12:29:59 GMT 2023 - 3.9K bytes - Viewed (0)