Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 21 for 5007 (0.31 sec)

  1. tests/test_additional_responses_response_class.py

    class JsonApiError(BaseModel):
        errors: typing.List[Error]
    
    
    @app.get(
        "/a",
        response_class=JsonApiResponse,
        responses={500: {"description": "Error", "model": JsonApiError}},
    )
    async def a():
        pass  # pragma: no cover
    
    
    @app.get("/b", responses={500: {"description": "Error", "model": Error}})
    async def b():
        pass  # pragma: no cover
    
    
    client = TestClient(app)
    
    
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 3.5K bytes
    - Viewed (0)
  2. tests/test_response_code_no_body.py

        status: str
        title: str
    
    
    class JsonApiError(BaseModel):
        errors: typing.List[Error]
    
    
    @app.get(
        "/a",
        status_code=204,
        response_class=JsonApiResponse,
        responses={500: {"description": "Error", "model": JsonApiError}},
    )
    async def a():
        pass
    
    
    @app.get("/b", responses={204: {"description": "No Content"}})
    async def b():
        pass  # pragma: no cover
    
    
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 3.2K bytes
    - Viewed (0)
  3. tests/test_tutorial/test_dependencies/test_tutorial008d_an.py

        from docs_src.dependencies.tutorial008d_an import app
    
        client = TestClient(app, raise_server_exceptions=False)
        response = client.get("/items/portal-gun")
        assert response.status_code == 500, response.text
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Feb 24 23:06:37 GMT 2024
    - 1.2K bytes
    - Viewed (0)
  4. docs/en/docs/img/deployment/https/https01.drawio

                        </mxGeometry>
                    </mxCell>
                    <mxCell id="33" value="" style="group" parent="1" vertex="1" connectable="0">
                        <mxGeometry x="-140" y="-75" width="500" height="350" as="geometry"/>
                    </mxCell>
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu May 12 00:06:16 GMT 2022
    - 6.2K bytes
    - Viewed (0)
  5. docs/en/docs/advanced/middleware.md

    ```Python hl_lines="2  6"
    {!../../../docs_src/advanced_middleware/tutorial003.py!}
    ```
    
    The following arguments are supported:
    
    * `minimum_size` - Do not GZip responses that are smaller than this minimum size in bytes. Defaults to `500`.
    
    ## Other middlewares
    
    There are many other ASGI middlewares.
    
    For example:
    
    * <a href="https://docs.sentry.io/platforms/python/guides/fastapi/" class="external-link" target="_blank">Sentry</a>
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 10 18:27:10 GMT 2023
    - 4K bytes
    - Viewed (0)
  6. docs/em/docs/tutorial/response-status-code.md

    * **`300`** &amp; ๐Ÿ”› "โŽ". ๐Ÿ“จ โฎ๏ธ ๐Ÿ‘ซ ๐Ÿ‘” ๐Ÿ“Ÿ 5๏ธโƒฃ๐Ÿ“† โš–๏ธ 5๏ธโƒฃ๐Ÿ“† ๐Ÿšซ โœ”๏ธ ๐Ÿ’ช, ๐ŸŒ– `304`, "๐Ÿšซ ๐Ÿ”€", โ” ๐Ÿ”œ ๐Ÿšซ โœ”๏ธ 1๏ธโƒฃ.
    * **`400`** &amp; ๐Ÿ”› "๐Ÿ‘ฉโ€๐Ÿ’ป โŒ" ๐Ÿ“จ. ๐Ÿ‘ซ ๐Ÿฅˆ ๐Ÿ†Ž ๐Ÿ‘† ๐Ÿ”œ ๐ŸŽฒ โš™๏ธ ๐Ÿ†.
        * ๐Ÿ–ผ `404`, "๐Ÿšซ ๐Ÿ”Ž" ๐Ÿ“จ.
        * ๐Ÿ’Š โŒ โšช๏ธโžก๏ธ ๐Ÿ‘ฉโ€๐Ÿ’ป, ๐Ÿ‘† ๐Ÿ’ช โš™๏ธ `400`.
    * `500` &amp; ๐Ÿ”› ๐Ÿ’ฝ โŒ. ๐Ÿ‘† ๐ŸŒ– ๐Ÿ™… โš™๏ธ ๐Ÿ‘ซ ๐Ÿ”—. ๐Ÿ•โ” ๐Ÿ•ณ ๐Ÿšถ โŒ ๐Ÿ• ๐Ÿ‘† ๐Ÿˆธ ๐Ÿ“Ÿ, โš–๏ธ ๐Ÿ’ฝ, โšซ๏ธ ๐Ÿ”œ ๐Ÿ” ๐Ÿ“จ 1๏ธโƒฃ ๐Ÿ‘ซ ๐Ÿ‘” ๐Ÿ“Ÿ.
    
    !!! tip
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Apr 01 09:26:04 GMT 2023
    - 3.4K bytes
    - Viewed (0)
  7. docs/zh/docs/tutorial/handling-errors.md

    **FastAPI** ่ฐƒ็”จ็š„ๅฐฑๆ˜ฏ `RequestValidationError` ็ฑป๏ผŒๅ› ๆญค๏ผŒๅฆ‚ๆžœๅœจ `response_model` ไธญไฝฟ็”จ Pydantic ๆจกๅž‹๏ผŒไธ”ๆ•ฐๆฎๆœ‰้”™่ฏฏๆ—ถ๏ผŒๅœจๆ—ฅๅฟ—ไธญๅฐฑไผš็œ‹ๅˆฐ่ฟ™ไธช้”™่ฏฏใ€‚
    
    ไฝ†ๅฎขๆˆท็ซฏๆˆ–็”จๆˆท็œ‹ไธๅˆฐ่ฟ™ไธช้”™่ฏฏใ€‚ๅไน‹๏ผŒๅฎขๆˆท็ซฏๆŽฅๆ”ถๅˆฐ็š„ๆ˜ฏ HTTP ็Šถๆ€็ ไธบ `500` ็š„ใ€Œๅ†…้ƒจๆœๅŠกๅ™จ้”™่ฏฏใ€ใ€‚
    
    ่ฟ™ๆ˜ฏๅ› ไธบๅœจ*ๅ“ๅบ”*ๆˆ–ไปฃ็ ๏ผˆไธๆ˜ฏๅœจๅฎขๆˆท็ซฏ็š„่ฏทๆฑ‚้‡Œ๏ผ‰ไธญๅ‡บ็Žฐ็š„ Pydantic `ValidationError` ๆ˜ฏไปฃ็ ็š„ bugใ€‚
    
    ไฟฎๅค้”™่ฏฏๆ—ถ๏ผŒๅฎขๆˆท็ซฏๆˆ–็”จๆˆทไธ่ƒฝ่ฎฟ้—ฎ้”™่ฏฏ็š„ๅ†…้ƒจไฟกๆฏ๏ผŒๅฆๅˆ™ไผš้€ ๆˆๅฎ‰ๅ…จ้šๆ‚ฃใ€‚
    
    ### ่ฆ†็›– `HTTPException` ้”™่ฏฏๅค„็†ๅ™จ
    
    ๅŒ็†๏ผŒไนŸๅฏไปฅ่ฆ†็›– `HTTPException` ๅค„็†ๅ™จใ€‚
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 8.4K bytes
    - Viewed (0)
  8. docs/em/docs/tutorial/handling-errors.md

    **FastAPI** โš™๏ธ โšซ๏ธ ๐Ÿ‘ˆ, ๐Ÿšฅ ๐Ÿ‘† โš™๏ธ Pydantic ๐Ÿท `response_model`, &amp; ๐Ÿ‘† ๐Ÿ’ฝ โœ”๏ธ โŒ, ๐Ÿ‘† ๐Ÿ”œ ๐Ÿ‘€ โŒ ๐Ÿ‘† ๐Ÿ•น.
    
    โœ‹๏ธ ๐Ÿ‘ฉโ€๐Ÿ’ป/๐Ÿ‘ฉโ€๐Ÿ’ป ๐Ÿ”œ ๐Ÿšซ ๐Ÿ‘€ โšซ๏ธ. โ†ฉ๏ธ, ๐Ÿ‘ฉโ€๐Ÿ’ป ๐Ÿ”œ ๐Ÿ“จ "๐Ÿ”— ๐Ÿ’ฝ โŒ" โฎ๏ธ ๐Ÿ‡บ๐Ÿ‡ธ๐Ÿ” ๐Ÿ‘” ๐Ÿ“Ÿ `500`.
    
    โšซ๏ธ ๐Ÿ”œ ๐Ÿ‘‰ ๐ŸŒŒ โ†ฉ๏ธ ๐Ÿšฅ ๐Ÿ‘† โœ”๏ธ Pydantic `ValidationError` ๐Ÿ‘† *๐Ÿ“จ* โš–๏ธ ๐Ÿ™† ๐Ÿ‘† ๐Ÿ“Ÿ (๐Ÿšซ ๐Ÿ‘ฉโ€๐Ÿ’ป *๐Ÿ“จ*), โšซ๏ธ ๐Ÿค™ ๐Ÿ› ๐Ÿ‘† ๐Ÿ“Ÿ.
    
    &amp; โช ๐Ÿ‘† ๐Ÿ”ง โšซ๏ธ, ๐Ÿ‘† ๐Ÿ‘ฉโ€๐Ÿ’ป/๐Ÿ‘ฉโ€๐Ÿ’ป ๐Ÿšซ๐Ÿ”œ ๐Ÿšซ โœ”๏ธ ๐Ÿ” ๐Ÿ”— โ„น ๐Ÿ”ƒ โŒ, ๐Ÿ‘ˆ ๐Ÿ’ช ๐ŸŽฆ ๐Ÿ’‚โ€โ™‚ โš .
    
    ### ๐Ÿ” `HTTPException` โŒ ๐Ÿ•โ€๐Ÿฆบ
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 8.3K bytes
    - Viewed (0)
  9. docs/en/docs/js/custom.js

                ul.append(li)
            })
        }
    
        setupTermynal();
        showRandomAnnouncement('announce-left', 5000)
        showRandomAnnouncement('announce-right', 10000)
    }
    
    JavaScript
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat May 08 17:50:56 GMT 2021
    - 6.6K bytes
    - Viewed (0)
  10. tests/test_exception_handlers.py

    
    def request_validation_exception_handler(request, exception):
        return JSONResponse({"exception": "request-validation"})
    
    
    def server_error_exception_handler(request, exception):
        return JSONResponse(status_code=500, content={"exception": "server-error"})
    
    
    app = FastAPI(
        exception_handlers={
            HTTPException: http_exception_handler,
            RequestValidationError: request_validation_exception_handler,
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Feb 17 12:40:12 GMT 2022
    - 1.9K bytes
    - Viewed (0)
Back to top