Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 636 for responses (0.2 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 Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Oct 18 12:36:40 GMT 2023
    - 1.7K bytes
    - Viewed (0)
  2. 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 Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 1.1K bytes
    - Viewed (0)
  3. 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 Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 5.1K bytes
    - Viewed (0)
  4. 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 Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 2.9K bytes
    - Viewed (0)
  5. 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 Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 3.5K 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 Apr 28 07:19:10 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 Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 5.8K bytes
    - Viewed (0)
  8. tests/test_application.py

        assert response.status_code == 200, response.text
        assert response.headers["content-type"] == "text/html; charset=utf-8"
        assert "window.opener.swaggerUIRedirectOauth2" in response.text
    
    
    def test_redoc():
        response = client.get("/redoc")
        assert response.status_code == 200, response.text
        assert response.headers["content-type"] == "text/html; charset=utf-8"
        assert "redoc@next" in response.text
    
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 21:56:59 GMT 2024
    - 52.2K bytes
    - Viewed (0)
  9. tests/test_schema_extra_examples.py

        response = client.get("/query_examples/")
        assert response.status_code == 200, response.text
        response = client.get("/query_example_examples/")
        assert response.status_code == 200, response.text
        response = client.get("/header_example/")
        assert response.status_code == 200, response.text
        response = client.get("/header_examples/")
        assert response.status_code == 200, response.text
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Oct 24 20:26:06 GMT 2023
    - 37.7K bytes
    - Viewed (0)
  10. tests/test_starlette_exception.py

    
    def test_get_item():
        response = client.get("/items/foo")
        assert response.status_code == 200, response.text
        assert response.json() == {"item": "The Foo Wrestlers"}
    
    
    def test_get_item_not_found():
        response = client.get("/items/bar")
        assert response.status_code == 404, response.text
        assert response.headers.get("x-error") == "Some custom header"
        assert response.json() == {"detail": "Item not found"}
    
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 7.4K bytes
    - Viewed (0)
Back to top