Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for escape (0.21 sec)

  1. docs_src/wsgi/tutorial001.py

    from fastapi import FastAPI
    from fastapi.middleware.wsgi import WSGIMiddleware
    from flask import Flask, request
    from markupsafe import escape
    
    flask_app = Flask(__name__)
    
    
    @flask_app.route("/")
    def flask_main():
        name = request.args.get("name", "World")
        return f"Hello, {escape(name)} from Flask!"
    
    
    app = FastAPI()
    
    
    @app.get("/v2")
    def read_main():
        return {"message": "Hello World"}
    
    
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue May 09 14:32:00 GMT 2023
    - 443 bytes
    - Viewed (0)
  2. tests/test_route_scope.py

    
    @app.get("/users/{user_id}")
    async def get_user(user_id: str, request: Request):
        route: APIRoute = request.scope["route"]
        return {"user_id": user_id, "path": route.path}
    
    
    @app.websocket("/items/{item_id}")
    async def websocket_item(item_id: str, websocket: WebSocket):
        route: APIWebSocketRoute = websocket.scope["route"]
        await websocket.accept()
        await websocket.send_json({"item_id": item_id, "path": route.path})
    
    
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Wed Feb 08 10:23:07 GMT 2023
    - 1.5K bytes
    - Viewed (0)
  3. docs/en/docs/advanced/path-operation-advanced-configuration.md

    {!../../../docs_src/path_operation_advanced_configuration/tutorial003.py!}
    ```
    
    ## Advanced description from docstring
    
    You can limit the lines used from the docstring of a *path operation function* for OpenAPI.
    
    Adding an `\f` (an escaped "form feed" character) causes **FastAPI** to truncate the output used for OpenAPI at this point.
    
    It won't show up in the documentation, but other tools (such as Sphinx) will be able to use the rest.
    
    ```Python hl_lines="19-29"
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 7.7K bytes
    - Viewed (0)
  4. docs/en/docs/release-notes.md

    * 🌐 Add Russian translation for `docs/ru/docs/tutorial/response-status-code.md`. PR [#9370](https://github.com/tiangolo/fastapi/pull/9370) by [@nadia3373](https://github.com/nadia3373).
    
    ### Internal
    
    * 🐛 Fix `flask.escape` warning for internal tests. PR [#9468](https://github.com/tiangolo/fastapi/pull/9468) by [@samuelcolvin](https://github.com/samuelcolvin).
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri May 03 23:25:42 GMT 2024
    - 388.1K bytes
    - Viewed (1)
  5. docs/fr/docs/python-types.md

    ```
    John Doe
    ```
    
    La fonction :
    
    * Prend un `first_name` et un `last_name`.
    * Convertit la première lettre de chaque paramètre en majuscules grâce à `title()`.
    * Concatène les résultats avec un espace entre les deux.
    
    ```Python hl_lines="2"
    {!../../../docs_src/python_types/tutorial001.py!}
    ```
    
    ### Limitations
    
    C'est un programme très simple.
    
    Mais maintenant imaginez que vous l'écriviez de zéro.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 10.3K bytes
    - Viewed (0)
  6. docs/pt/docs/alternatives.md

        Ser simples e com sistema de roteamento fácil de usar.
    
    ### <a href="https://requests.readthedocs.io" class="external-link" target="_blank">Requests</a>
    
    **FastAPI** não é uma alternativa para **Requests**. O escopo deles é muito diferente.
    
    Na verdade é comum utilizar Requests *dentro* de uma aplicação FastAPI.
    
    Ainda assim, FastAPI pegou alguma inspiração do Requests.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 25.5K bytes
    - Viewed (0)
Back to top