Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 39 for something (0.23 sec)

  1. docs/en/docs/tutorial/middleware.md

    * It takes each **request** that comes to your application.
    * It can then do something to that **request** or run any needed code.
    * Then it passes the **request** to be processed by the rest of the application (by some *path operation*).
    * It then takes the **response** generated by the application (by some *path operation*).
    * It can do something to that **response** or run any needed code.
    * Then it returns the **response**.
    
    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)
  2. docs/en/docs/advanced/middleware.md

    In general, ASGI middlewares are classes that expect to receive an ASGI app as the first argument.
    
    So, in the documentation for third-party ASGI middlewares they will probably tell you to do something like:
    
    ```Python
    from unicorn import UnicornMiddleware
    
    app = SomeASGIApp()
    
    new_app = UnicornMiddleware(app, some_config="rainbow")
    ```
    
    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)
  3. docs/en/docs/how-to/index.md

    Most of these ideas would be more or less **independent**, and in most cases you should only need to study them if they apply directly to **your project**.
    
    If something seems interesting and useful to your project, go ahead and check it, but otherwise, you might probably just skip them.
    
    !!! tip
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Aug 19 19:54:04 GMT 2023
    - 591 bytes
    - Viewed (0)
  4. docs_src/handling_errors/tutorial003.py

    @app.exception_handler(UnicornException)
    async def unicorn_exception_handler(request: Request, exc: UnicornException):
        return JSONResponse(
            status_code=418,
            content={"message": f"Oops! {exc.name} did something. There goes a rainbow..."},
        )
    
    
    @app.get("/unicorns/{name}")
    async def read_unicorn(name: str):
        if name == "yolo":
            raise UnicornException(name=name)
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Mar 26 19:09:53 GMT 2020
    - 626 bytes
    - Viewed (0)
  5. docs/ko/docs/tutorial/dependencies/classes-as-dependencies.md

    아마도 더 일반적이기는 하겠지만 의존성을 선언하는 유일한 방법은 아닙니다.
    
    핵심 요소는 의존성이 "호출 가능"해야 한다는 것입니다
    
    파이썬에서의 "**호출 가능**"은 파이썬이 함수처럼 "호출"할 수 있는 모든 것입니다.
    
    따라서, 만약 당신이 `something`(함수가 아닐 수도 있음) 객체를 가지고 있고,
    
    ```Python
    something()
    ```
    
    또는
    
    ```Python
    something(some_argument, some_keyword_argument="foo")
    ```
    
    상기와 같은 방식으로 "호출(실행)" 할 수 있다면 "호출 가능"이 됩니다.
    
    ## 의존성으로서의 클래스
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sun Feb 11 13:48:31 GMT 2024
    - 8K bytes
    - Viewed (0)
  6. docs/en/docs/how-to/async-sql-encode-databases.md

    ### About `{**note.dict(), "id": last_record_id}`
    
    `note` is a Pydantic `Note` object.
    
    `note.dict()` returns a `dict` with its data, something like:
    
    ```Python
    {
        "text": "Some note",
        "completed": False,
    }
    ```
    
    but it doesn't have the `id` field.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 5.3K bytes
    - Viewed (0)
  7. tests/test_custom_schema_fields.py

    class Item(BaseModel):
        name: str
    
        if PYDANTIC_V2:
            model_config = {
                "json_schema_extra": {
                    "x-something-internal": {"level": 4},
                }
            }
        else:
    
            class Config:
                schema_extra = {
                    "x-something-internal": {"level": 4},
                }
    
    
    @app.get("/foo", response_model=Item)
    def foo():
        return {"name": "Foo item"}
    
    
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 1.2K bytes
    - Viewed (0)
  8. docs/en/docs/tutorial/path-params.md

    Let's say you have a *path operation* with a path `/files/{file_path}`.
    
    But you need `file_path` itself to contain a *path*, like `home/johndoe/myfile.txt`.
    
    So, the URL for that file would be something like: `/files/home/johndoe/myfile.txt`.
    
    ### OpenAPI support
    
    OpenAPI doesn't support a way to declare a *path parameter* to contain a *path* inside, as that could lead to scenarios that are difficult to test and define.
    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)
  9. docs/en/docs/deployment/manually.md

            That including `uvloop`, the high-performance drop-in replacement for `asyncio`, that provides the big concurrency performance boost.
    
            When you install FastAPI with something like `pip install fastapi` you already get `uvicorn[standard]` as well.
    
    === "Hypercorn"
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu May 02 22:37:31 GMT 2024
    - 9.2K bytes
    - Viewed (0)
  10. docs/zh/docs/tutorial/handling-errors.md

    ```
    
    请求 `/unicorns/yolo` 时,路径操作会触发 `UnicornException`。
    
    但该异常将会被 `unicorn_exception_handler` 处理。
    
    接收到的错误信息清晰明了,HTTP 状态码为 `418`,JSON 内容如下:
    
    ```JSON
    {"message": "Oops! yolo did something. There goes a rainbow..."}
    
    ```
    
    !!! note "技术细节"
    
        `from starlette.requests import Request` 和 `from starlette.responses import JSONResponse` 也可以用于导入 `Request` 和 `JSONResponse`。
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 8.4K bytes
    - Viewed (0)
Back to top