Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 68 for pcall (0.15 sec)

  1. fastapi/dependencies/models.py

            self.name = name
            self.call = call
            self.use_cache = use_cache
            # Store the path to be able to re-generate a dependable from it in overrides
            self.path = path
            # Save the cache key at creation to optimize performance
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 2.4K bytes
    - Viewed (0)
  2. tests/test_ws_router.py

                    return await app(scope, receive, send)  # pragma: no cover
    
                async def call_next():
                    return await app(scope, receive, send)
    
                websocket = WebSocket(scope, receive=receive, send=send)
                return await middleware_func(websocket, call_next)
    
            return wrapped_app
    
        return middleware_constructor
    
    
    def test_depend_validation():
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sun Jun 11 19:08:14 GMT 2023
    - 7.5K bytes
    - Viewed (0)
  3. tests/test_dependency_contextvars.py

        yield request_state
        legacy_request_state_context_var.reset(contextvar_token)
    
    
    @app.middleware("http")
    async def custom_middleware(
        request: Request, call_next: Callable[[Request], Awaitable[Response]]
    ):
        response = await call_next(request)
        response.headers["custom"] = "foo"
        return response
    
    
    @app.get("/user", dependencies=[Depends(set_up_request_state_dependency)])
    def get_user():
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Feb 17 12:40:12 GMT 2022
    - 1.5K bytes
    - Viewed (0)
  4. docs_src/dependencies/tutorial011_an_py39.py

    from typing import Annotated
    
    from fastapi import Depends, FastAPI
    
    app = FastAPI()
    
    
    class FixedContentQueryChecker:
        def __init__(self, fixed_content: str):
            self.fixed_content = fixed_content
    
        def __call__(self, q: str = ""):
            if q:
                return self.fixed_content in q
            return False
    
    
    checker = FixedContentQueryChecker("bar")
    
    
    @app.get("/query-checker/")
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 544 bytes
    - Viewed (0)
  5. docs/ko/docs/tutorial/middleware.md

        만약 (나중에 문서에서 다룰) 백그라운드 작업이 있다면, 모든 미들웨어가 실행되고 *난 후에* 실행됩니다.
    
    ## 미들웨어 만들기
    
    미들웨어를 작성하기 위해서 함수 상단에 `@app.middleware("http")` 데코레이터를 사용할 수 있습니다.
    
    미들웨어 함수는 다음 항목들을 받습니다:
    
    * `request`.
    * `request`를 매개변수로 받는 `call_next` 함수.
        * 이 함수는 `request`를 해당하는 *경로 작업*으로 전달합니다.
        * 그런 다음, *경로 작업*에 의해 생성된 `response` 를 반환합니다.
    * `response`를 반환하기 전에 추가로 `response`를 수정할 수 있습니다.
    
    ```Python hl_lines="8-9  11  14"
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Jan 31 14:35:27 GMT 2024
    - 3.4K bytes
    - Viewed (0)
  6. docs/em/docs/advanced/settings.md

    $ python main.py
    
    // As we didn't set the env var, we get the default value
    
    Hello World from Python
    
    // But if we create an environment variable first
    $ export MY_NAME="Wade Wilson"
    
    // And then call the program again
    $ python main.py
    
    // Now it can read the environment variable
    
    Hello Wade Wilson from Python
    ```
    
    </div>
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 11.4K bytes
    - Viewed (0)
  7. docs/en/docs/python-types.md

    It's a very simple program.
    
    But now imagine that you were writing it from scratch.
    
    At some point you would have started the definition of the function, you had the parameters ready...
    
    But then you have to call "that method that converts the first letter to upper case".
    
    Was it `upper`? Was it `uppercase`? `first_uppercase`? `capitalize`?
    
    Then, you try with the old programmer's friend, editor autocompletion.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 17K bytes
    - Viewed (0)
  8. docs/en/docs/tutorial/security/oauth2-jwt.md

    Username: `johndoe`
    Password: `secret`
    
    !!! check
        Notice that nowhere in the code is the plaintext password "`secret`", we only have the hashed version.
    
    <img src="/img/tutorial/security/image08.png">
    
    Call the endpoint `/users/me/`, you will get the response as:
    
    ```JSON
    {
      "username": "johndoe",
      "email": "******@****.***",
      "full_name": "John Doe",
      "disabled": false
    }
    ```
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 13K bytes
    - Viewed (0)
  9. tests/test_schema_extra_examples.py

                    example="cookie_overridden",
                    examples=["cookie1", "cookie2"],
                ),
            ):
                return data
    
        return app
    
    
    def test_call_api():
        app = create_app()
        client = TestClient(app)
        response = client.post("/schema_extra/", json={"data": "Foo"})
        assert response.status_code == 200, response.text
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Oct 24 20:26:06 GMT 2023
    - 37.7K bytes
    - Viewed (0)
  10. docs/en/docs/release-notes.md

    This has **several benefits**, one of the main ones is that now the parameters of your functions with `Annotated` would **not be affected** at all.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sun Apr 28 00:28:00 GMT 2024
    - 385.5K bytes
    - Viewed (1)
Back to top