Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 203 for body (0.15 sec)

  1. fastapi/exception_handlers.py

    from fastapi.encoders import jsonable_encoder
    from fastapi.exceptions import RequestValidationError, WebSocketRequestValidationError
    from fastapi.utils import is_body_allowed_for_status_code
    from fastapi.websockets import WebSocket
    from starlette.exceptions import HTTPException
    from starlette.requests import Request
    from starlette.responses import JSONResponse, Response
    from starlette.status import HTTP_422_UNPROCESSABLE_ENTITY, WS_1008_POLICY_VIOLATION
    
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sun Jun 11 19:08:14 GMT 2023
    - 1.3K bytes
    - Viewed (0)
  2. docs_src/request_files/tutorial003_an.py

    
    @app.get("/")
    async def main():
        content = """
    <body>
    <form action="/files/" enctype="multipart/form-data" method="post">
    <input name="files" type="file" multiple>
    <input type="submit">
    </form>
    <form action="/uploadfiles/" enctype="multipart/form-data" method="post">
    <input name="files" type="file" multiple>
    <input type="submit">
    </form>
    </body>
        """
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 987 bytes
    - Viewed (0)
  3. docs_src/websockets/tutorial002_py310.py

        WebSocketException,
        status,
    )
    from fastapi.responses import HTMLResponse
    
    app = FastAPI()
    
    html = """
    <!DOCTYPE html>
    <html>
        <head>
            <title>Chat</title>
        </head>
        <body>
            <h1>WebSocket Chat</h1>
            <form action="" onsubmit="sendMessage(event)">
                <label>Item ID: <input type="text" id="itemId" autocomplete="off" value="foo"/></label>
    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)
  4. tests/test_tutorial/test_dataclasses/test_tutorial001.py

                        "loc": ["body", "price"],
                        "msg": "Input should be a valid number, unable to parse string as a number",
                        "input": "invalid price",
                    }
                ]
            }
        ) | IsDict(
            # TODO: remove when deprecating Pydantic v1
            {
                "detail": [
                    {
                        "loc": ["body", "price"],
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 5.2K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_security/test_tutorial005_an_py39.py

                            "token_type": {"title": "Token Type", "type": "string"},
                        },
                    },
                    "Body_login_for_access_token_token_post": {
                        "title": "Body_login_for_access_token_token_post",
                        "required": ["username", "password"],
                        "type": "object",
                        "properties": {
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:07:10 GMT 2024
    - 16.3K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_security/test_tutorial005_py310.py

                            "token_type": {"title": "Token Type", "type": "string"},
                        },
                    },
                    "Body_login_for_access_token_token_post": {
                        "title": "Body_login_for_access_token_token_post",
                        "required": ["username", "password"],
                        "type": "object",
                        "properties": {
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:07:10 GMT 2024
    - 16.3K bytes
    - Viewed (0)
  7. tests/test_local_docs.py

        )
        body_content = html.body.decode()
        assert redoc_js_url in body_content
        assert redoc_favicon_url in body_content
    
    
    def test_google_fonts_in_generated_redoc():
        body_with_google_fonts = get_redoc_html(
            openapi_url="/docs", title="title"
        ).body.decode()
        assert "fonts.googleapis.com" in body_with_google_fonts
        body_without_google_fonts = get_redoc_html(
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sun Dec 20 18:50:00 GMT 2020
    - 2.4K bytes
    - Viewed (0)
  8. tests/test_tutorial/test_request_forms_and_files/test_tutorial001.py

        client = TestClient(app)
        return client
    
    
    def test_post_form_no_body(client: TestClient):
        response = client.post("/files/")
        assert response.status_code == 422, response.text
        assert response.json() == IsDict(
            {
                "detail": [
                    {
                        "type": "missing",
                        "loc": ["body", "file"],
                        "msg": "Field required",
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 9.8K bytes
    - Viewed (0)
  9. tests/test_required_noneable.py

    
    def test_required_nonable_body_embed_no_content():
        response = client.post("/body-embed")
        assert response.status_code == 422
    
    
    def test_required_nonable_body_embed_invalid():
        response = client.post("/body-embed", json={"invalid": "invalid"})
        assert response.status_code == 422
    
    
    def test_required_noneable_body_embed_value():
        response = client.post("/body-embed", json={"b": "foo"})
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat May 14 19:08:31 GMT 2022
    - 1.5K bytes
    - Viewed (0)
  10. tests/test_tutorial/test_body_multiple_params/test_tutorial003_an_py310.py

                        "loc": ["body", "item"],
                        "msg": "field required",
                        "type": "value_error.missing",
                    },
                    {
                        "loc": ["body", "user"],
                        "msg": "field required",
                        "type": "value_error.missing",
                    },
                    {
                        "loc": ["body", "importance"],
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 9.5K bytes
    - Viewed (0)
Back to top