Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 387 for Kata (0.14 sec)

  1. tests/test_tutorial/test_websockets/test_tutorial002_py310.py

                assert data == "Session cookie or query token value is: some-token"
                data = websocket.receive_text()
                assert data == f"Message text was: {message}, for item ID: bar"
                message = "Message two"
                websocket.send_text(message)
                data = websocket.receive_text()
                assert data == "Session cookie or query token value is: some-token"
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 3.9K bytes
    - Viewed (0)
  2. fastapi/security/oauth2.py

    
        @app.post("/login")
        def login(form_data: Annotated[OAuth2PasswordRequestForm, Depends()]):
            data = {}
            data["scopes"] = []
            for scope in form_data.scopes:
                data["scopes"].append(scope)
            if form_data.client_id:
                data["client_id"] = form_data.client_id
            if form_data.client_secret:
                data["client_secret"] = form_data.client_secret
            return data
        ```
    
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 21.1K bytes
    - Viewed (1)
  3. tests/test_ws_dependencies.py

        client = TestClient(app)
        with client.websocket_connect("/") as websocket:
            data = json.loads(websocket.receive_text())
            assert data == ["app", "index"]
    
    
    def test_routerindex():
        client = TestClient(app)
        with client.websocket_connect("/router") as websocket:
            data = json.loads(websocket.receive_text())
            assert data == ["app", "router2", "router", "routerindex"]
    
    
    def test_routerprefixindex():
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Sun Jun 11 20:35:39 GMT 2023
    - 2.1K bytes
    - Viewed (0)
  4. docs/en/docs/tutorial/response-model.md

        ```
    
    FastAPI will use this return type to:
    
    * **Validate** the returned data.
        * If the data is invalid (e.g. you are missing a field), it means that *your* app code is broken, not returning what it should, and it will return a server error instead of returning incorrect data. This way you and your clients can be certain that they will receive the data and the data shape expected.
    * Add a **JSON Schema** for the response, in the OpenAPI *path operation*.
    Plain Text
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 17.9K bytes
    - Viewed (0)
  5. docs/en/docs/advanced/dataclasses.md

    And of course, it supports the same:
    
    * data validation
    * data serialization
    * data documentation, etc.
    
    This works the same way as with Pydantic models. And it is actually achieved in the same way underneath, using Pydantic.
    
    !!! info
    Plain Text
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 4.1K bytes
    - Viewed (0)
  6. docs_src/security/tutorial004.py

        return current_user
    
    
    @app.post("/token")
    async def login_for_access_token(
        form_data: OAuth2PasswordRequestForm = Depends(),
    ) -> Token:
        user = authenticate_user(fake_users_db, form_data.username, form_data.password)
        if not user:
            raise HTTPException(
                status_code=status.HTTP_401_UNAUTHORIZED,
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Tue Mar 26 16:56:53 GMT 2024
    - 4K bytes
    - Viewed (0)
  7. docs_src/security/tutorial004_an.py

        return current_user
    
    
    @app.post("/token")
    async def login_for_access_token(
        form_data: Annotated[OAuth2PasswordRequestForm, Depends()],
    ) -> Token:
        user = authenticate_user(fake_users_db, form_data.username, form_data.password)
        if not user:
            raise HTTPException(
                status_code=status.HTTP_401_UNAUTHORIZED,
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Tue Mar 26 16:56:53 GMT 2024
    - 4.1K bytes
    - Viewed (0)
  8. tests/test_validate_response.py

            client.get("/items/invalidnone")
    
    
    def test_valid_none_data():
        response = client.get("/items/validnone")
        data = response.json()
        assert response.status_code == 200
        assert data == {"name": "invalid", "price": 3.2, "owner_ids": None}
    
    
    def test_valid_none_none():
        response = client.get("/items/validnone", params={"send_none": "true"})
        data = response.json()
        assert response.status_code == 200
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 2K bytes
    - Viewed (0)
  9. docs/en/docs/benchmarks.md

        * If you didn't use FastAPI and used Starlette directly (or another tool, like Sanic, Flask, Responder, etc) you would have to implement all the data validation and serialization yourself. So, your final application would...
    Plain Text
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 3.4K bytes
    - Viewed (0)
  10. docs/en/docs/alternatives.md

    One of the main features needed by API systems is data "<abbr title="also called marshalling, conversion">serialization</abbr>" which is taking data from the code (Python) and converting it into something that can be sent through the network. For example, converting an object containing data from a database into a JSON object. Converting `datetime` objects into strings, etc.
    
    Plain Text
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 23.2K bytes
    - Viewed (0)
Back to top