Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 21 for midpoint (0.28 sec)

  1. docs_src/websockets/tutorial002_py310.py

    ):
        if session is None and token is None:
            raise WebSocketException(code=status.WS_1008_POLICY_VIOLATION)
        return session or token
    
    
    @app.websocket("/items/{item_id}/ws")
    async def websocket_endpoint(
        websocket: WebSocket,
        item_id: str,
        q: int | None = None,
        cookie_or_token: str = Depends(get_cookie_or_token),
    ):
        await websocket.accept()
        while True:
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 2.7K bytes
    - Viewed (0)
  2. fastapi/openapi/utils.py

        if operation_id in operation_ids:
            message = (
                f"Duplicate Operation ID {operation_id} for function "
                + f"{route.endpoint.__name__}"
            )
            file_name = getattr(route.endpoint, "__globals__", {}).get("__file__")
            if file_name:
                message += f" at {file_name}"
            warnings.warn(message, stacklevel=1)
        operation_ids.add(operation_id)
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 21.8K bytes
    - Viewed (0)
  3. fastapi/dependencies/utils.py

        name: Optional[str] = None,
        security_scopes: Optional[List[str]] = None,
        use_cache: bool = True,
    ) -> Dependant:
        path_param_names = get_path_param_names(path)
        endpoint_signature = get_typed_signature(call)
        signature_params = endpoint_signature.parameters
        dependant = Dependant(
            call=call,
            name=name,
            path=path,
            security_scopes=security_scopes,
            use_cache=use_cache,
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Apr 02 02:52:56 GMT 2024
    - 29.5K bytes
    - Viewed (0)
  4. tests/test_callable_endpoint.py

    from fastapi import FastAPI
    from fastapi.testclient import TestClient
    
    
    def main(some_arg, q: Optional[str] = None):
        return {"some_arg": some_arg, "q": q}
    
    
    endpoint = partial(main, "foo")
    
    app = FastAPI()
    
    app.get("/")(endpoint)
    
    
    client = TestClient(app)
    
    
    def test_partial():
        response = client.get("/?q=bar")
        data = response.json()
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sun Jun 28 18:13:30 GMT 2020
    - 457 bytes
    - Viewed (0)
  5. docs/sts/web-identity.py

    # keycloak id and secret
    client_id = 'account'
    client_secret = 'daaa3008-80f0-40f7-80d7-e15167531ff0'
    
    sts_client = boto3.client(
        'sts',
        region_name='us-east-1',
        use_ssl=False,
        endpoint_url='http://localhost:9000',
    )
    
    app = Flask(__name__)
    
    
    @app.route('/')
    def homepage():
        text = '<a href="%s">Authenticate with keycloak</a>'
        return text % make_authorization_url()
    
    
    Python
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Wed Jul 28 01:37:51 GMT 2021
    - 2.9K bytes
    - Viewed (1)
  6. tests/test_tutorial/test_custom_request_and_route/test_tutorial002.py

    from dirty_equals import IsDict
    from fastapi.testclient import TestClient
    
    from docs_src.custom_request_and_route.tutorial002 import app
    
    client = TestClient(app)
    
    
    def test_endpoint_works():
        response = client.post("/", json=[1, 2, 3])
        assert response.json() == 6
    
    
    def test_exception_handler_body_access():
        response = client.post("/", json={"numbers": [1, 2, 3]})
        assert response.json() == IsDict(
            {
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 1.2K bytes
    - Viewed (0)
  7. docs/sts/client-grants.py

        ClientGrantsCredentialProvider('NZLOOFRSluw9RfIkuHGqfk1HFp4a',
                                       '0Z4VTG8uJBSekn42HE40DK9vQb4a'),
    )
    
    boto3_session = Session(botocore_session=bc_session)
    s3 = boto3_session.resource('s3', endpoint_url='http://localhost:9000')
    
    with open('/etc/hosts', 'rb') as data:
        s3.meta.client.upload_fileobj(data,
                                      'testbucket',
                                      'hosts',
    Python
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Fri Apr 23 18:58:53 GMT 2021
    - 1.2K bytes
    - Viewed (0)
  8. docs_src/websockets/tutorial003_py39.py

    
    manager = ConnectionManager()
    
    
    @app.get("/")
    async def get():
        return HTMLResponse(html)
    
    
    @app.websocket("/ws/{client_id}")
    async def websocket_endpoint(websocket: WebSocket, client_id: int):
        await manager.connect(websocket)
        try:
            while True:
                data = await websocket.receive_text()
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 2.5K bytes
    - Viewed (0)
  9. fastapi/applications.py

            generate_unique_id_function: Callable[[routing.APIRoute], str] = Default(
                generate_unique_id
            ),
        ) -> None:
            self.router.add_api_route(
                path,
                endpoint=endpoint,
                response_model=response_model,
                status_code=status_code,
                tags=tags,
                dependencies=dependencies,
                summary=summary,
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 172.2K bytes
    - Viewed (0)
  10. fastapi/routing.py

            self,
            path: str,
            endpoint: Callable[..., Any],
            *,
            name: Optional[str] = None,
            dependencies: Optional[Sequence[params.Depends]] = None,
            dependency_overrides_provider: Optional[Any] = None,
        ) -> None:
            self.path = path
            self.endpoint = endpoint
            self.name = get_name(endpoint) if name is None else name
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 170.1K bytes
    - Viewed (0)
Back to top