Home / Function/ __call__() — fastapi Function Reference

__call__() — fastapi Function Reference

Architecture documentation for the __call__() function in http.py from the fastapi codebase.

Entity Profile

Dependency Diagram

graph TD
  cb3daacf_079f_f435_38c5_84f493cf166b["__call__()"]
  3095b424_1269_68c9_350e_1ccbc9dc52df["HTTPBase"]
  cb3daacf_079f_f435_38c5_84f493cf166b -->|defined in| 3095b424_1269_68c9_350e_1ccbc9dc52df
  8a4f3cb1_2bb3_9484_ab7e_5424511db588["make_not_authenticated_error()"]
  cb3daacf_079f_f435_38c5_84f493cf166b -->|calls| 8a4f3cb1_2bb3_9484_ab7e_5424511db588
  21dea0a2_f30d_d3da_ce48_734fa9836d52["get_authorization_scheme_param()"]
  cb3daacf_079f_f435_38c5_84f493cf166b -->|calls| 21dea0a2_f30d_d3da_ce48_734fa9836d52
  style cb3daacf_079f_f435_38c5_84f493cf166b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

fastapi/security/http.py lines 94–104

    async def __call__(
        self, request: Request
    ) -> Optional[HTTPAuthorizationCredentials]:
        authorization = request.headers.get("Authorization")
        scheme, credentials = get_authorization_scheme_param(authorization)
        if not (authorization and scheme and credentials):
            if self.auto_error:
                raise self.make_not_authenticated_error()
            else:
                return None
        return HTTPAuthorizationCredentials(scheme=scheme, credentials=credentials)

Domain

Subdomains

Frequently Asked Questions

What does __call__() do?
__call__() is a function in the fastapi codebase, defined in fastapi/security/http.py.
Where is __call__() defined?
__call__() is defined in fastapi/security/http.py at line 94.
What does __call__() call?
__call__() calls 2 function(s): get_authorization_scheme_param, make_not_authenticated_error.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free