Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 570 for responses (0.17 sec)

  1. fastapi/responses.py

    from starlette.responses import FileResponse as FileResponse  # noqa
    from starlette.responses import HTMLResponse as HTMLResponse  # noqa
    from starlette.responses import JSONResponse as JSONResponse  # noqa
    from starlette.responses import PlainTextResponse as PlainTextResponse  # noqa
    from starlette.responses import RedirectResponse as RedirectResponse  # noqa
    from starlette.responses import Response as Response  # noqa
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Wed Oct 18 12:36:40 GMT 2023
    - 1.7K bytes
    - Viewed (0)
  2. tests/test_additional_responses_router.py

    
    def test_a():
        response = client.get("/a")
        assert response.status_code == 200, response.text
        assert response.json() == "a"
    
    
    def test_b():
        response = client.get("/b")
        assert response.status_code == 200, response.text
        assert response.json() == "b"
    
    
    def test_c():
        response = client.get("/c")
        assert response.status_code == 200, response.text
        assert response.json() == "c"
    
    
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 5.1K bytes
    - Viewed (0)
  3. tests/test_additional_responses_custom_validationerror.py

        response_class=JsonApiResponse,
        responses={422: {"description": "Error", "model": JsonApiError}},
    )
    async def a(id):
        pass  # pragma: no cover
    
    
    client = TestClient(app)
    
    
    def test_openapi_schema():
        response = client.get("/openapi.json")
        assert response.status_code == 200, response.text
        assert response.json() == {
            "openapi": "3.1.0",
            "info": {"title": "FastAPI", "version": "0.1.0"},
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 2.9K bytes
    - Viewed (0)
  4. tests/test_additional_responses_response_class.py

        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)
    
    
    def test_openapi_schema():
        response = client.get("/openapi.json")
        assert response.status_code == 200, response.text
    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)
  5. tests/test_additional_responses_bad.py

    app = FastAPI()
    
    
    @app.get("/a", responses={"hello": {"description": "Not a valid additional response"}})
    async def a():
        pass  # pragma: no cover
    
    
    openapi_schema = {
        "openapi": "3.1.0",
        "info": {"title": "FastAPI", "version": "0.1.0"},
        "paths": {
            "/a": {
                "get": {
                    "responses": {
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 1.1K bytes
    - Viewed (0)
  6. tests/test_additional_responses_default_validationerror.py

    client = TestClient(app)
    
    
    def test_openapi_schema():
        response = client.get("/openapi.json")
        assert response.status_code == 200, response.text
        assert response.json() == {
            "openapi": "3.1.0",
            "info": {"title": "FastAPI", "version": "0.1.0"},
            "paths": {
                "/a/{id}": {
                    "get": {
                        "responses": {
                            "422": {
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 2.8K bytes
    - Viewed (0)
  7. tests/test_additional_responses_custom_model_in_callback.py

    def main_route(callback_url: HttpUrl):
        pass  # pragma: no cover
    
    
    client = TestClient(app)
    
    
    def test_openapi_schema():
        response = client.get("/openapi.json")
        assert response.status_code == 200, response.text
        assert response.json() == {
            "openapi": "3.1.0",
            "info": {"title": "FastAPI", "version": "0.1.0"},
            "paths": {
                "/": {
                    "post": {
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 5.8K bytes
    - Viewed (0)
  8. tests/test_response_by_alias.py

        assert response.status_code == 200, response.text
        assert response.json() == {"alias": "Foo"}
    
    
    def test_read_model_by_alias():
        response = client.get("/by-alias/model")
        assert response.status_code == 200, response.text
        assert response.json() == {"alias": "Foo"}
    
    
    def test_read_list_by_alias():
        response = client.get("/by-alias/list")
        assert response.status_code == 200, response.text
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 11.1K bytes
    - Viewed (0)
  9. tests/test_response_code_no_body.py

        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
    
    
    client = TestClient(app)
    
    
    def test_get_response():
        response = client.get("/a")
        assert response.status_code == 204, response.text
    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)
  10. tests/test_include_router_defaults_overrides.py

    
    async def dep0(response: Response):
        response.headers["x-level0"] = "True"
    
    
    async def dep1(response: Response):
        response.headers["x-level1"] = "True"
    
    
    async def dep2(response: Response):
        response.headers["x-level2"] = "True"
    
    
    async def dep3(response: Response):
        response.headers["x-level3"] = "True"
    
    
    async def dep4(response: Response):
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 358.6K bytes
    - Viewed (0)
Back to top