Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 121 - 130 of 136 for JSONResponse (0.05 seconds)

  1. tests/test_response_model_as_return_annotation.py

        return Response(content="Foo")
    
    
    @app.get("/no_response_model-annotation_json_response_class")
    def no_response_model_annotation_json_response_class() -> JSONResponse:
        return JSONResponse(content={"foo": "bar"})
    
    
    client = TestClient(app)
    
    
    def test_no_response_model_no_annotation_return_model():
        response = client.get("/no_response_model-no_annotation-return_model")
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Sat Dec 27 12:54:56 GMT 2025
    - 47.7K bytes
    - Click Count (0)
  2. tests/test_include_router_defaults_overrides.py

    from fastapi.responses import JSONResponse
    from fastapi.testclient import TestClient
    
    
    class ResponseLevel0(JSONResponse):
        media_type = "application/x-level-0"
    
    
    class ResponseLevel1(JSONResponse):
        media_type = "application/x-level-1"
    
    
    class ResponseLevel2(JSONResponse):
        media_type = "application/x-level-2"
    
    
    class ResponseLevel3(JSONResponse):
        media_type = "application/x-level-3"
    
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 358.6K bytes
    - Click Count (0)
  3. docs/uk/docs/tutorial/handling-errors.md

    ```JSON
    {"message": "Oops! yolo did something. There goes a rainbow..."}
    ```
    
    /// note | Технічні деталі
    
    Ви також можете використовувати `from starlette.requests import Request` і `from starlette.responses import JSONResponse`.
    
    **FastAPI** надає ті самі `starlette.responses`, що й `fastapi.responses`, просто для зручності розробника. Але більшість доступних відповідей надходять безпосередньо зі Starlette. Те ж саме стосується і `Request`.
    
    ///
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Sat Oct 11 17:48:49 GMT 2025
    - 13.9K bytes
    - Click Count (0)
  4. docs/ru/docs/tutorial/handling-errors.md

    ```JSON
    {"message": "Oops! yolo did something. There goes a rainbow..."}
    ```
    
    /// note | Технические детали
    
    Также можно использовать `from starlette.requests import Request` и `from starlette.responses import JSONResponse`.
    
    **FastAPI** предоставляет тот же `starlette.responses`, что и `fastapi.responses`, просто для удобства разработчика. Однако большинство доступных ответов поступает непосредственно из Starlette. То же самое касается и `Request`.
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Dec 17 20:41:43 GMT 2025
    - 14.1K bytes
    - Click Count (0)
  5. docs/en/docs/tutorial/handling-errors.md

    ```JSON
    {"message": "Oops! yolo did something. There goes a rainbow..."}
    ```
    
    /// note | Technical Details
    
    You could also use `from starlette.requests import Request` and `from starlette.responses import JSONResponse`.
    
    **FastAPI** provides the same `starlette.responses` as `fastapi.responses` just as a convenience for you, the developer. But most of the available responses come directly from Starlette. The same with `Request`.
    
    ///
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Dec 17 20:41:43 GMT 2025
    - 9K bytes
    - Click Count (0)
  6. docs/pt/docs/tutorial/handling-errors.md

    ```JSON
    {"message": "Oops! yolo did something. There goes a rainbow..."}
    ```
    
    /// note | Detalhes Técnicos
    
    Você também pode usar `from starlette.requests import Request` e `from starlette.responses import JSONResponse`.
    
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Dec 17 20:41:43 GMT 2025
    - 10.2K bytes
    - Click Count (0)
  7. docs/es/docs/tutorial/handling-errors.md

    ```JSON
    {"message": "Oops! yolo did something. There goes a rainbow..."}
    ```
    
    /// note | Nota Técnica
    
    También podrías usar `from starlette.requests import Request` y `from starlette.responses import JSONResponse`.
    
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Dec 17 20:41:43 GMT 2025
    - 9.7K bytes
    - Click Count (0)
  8. docs/de/docs/tutorial/handling-errors.md

    ```JSON
    {"message": "Oops! yolo did something. There goes a rainbow..."}
    ```
    
    /// note | Technische Details
    
    Sie könnten auch `from starlette.requests import Request` und `from starlette.responses import JSONResponse` verwenden.
    
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Dec 17 20:41:43 GMT 2025
    - 10.4K bytes
    - Click Count (0)
  9. docs/en/docs/tutorial/response-model.md

    This simple case is handled automatically by FastAPI because the return type annotation is the class (or a subclass of) `Response`.
    
    And tools will also be happy because both `RedirectResponse` and `JSONResponse` are subclasses of `Response`, so the type annotation is correct.
    
    ### Annotate a Response Subclass { #annotate-a-response-subclass }
    
    You can also use a subclass of `Response` in the type annotation:
    
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Sat Dec 20 15:55:38 GMT 2025
    - 15.5K bytes
    - Click Count (0)
  10. docs/pt/docs/tutorial/response-model.md

    Este caso simples é tratado automaticamente pelo FastAPI porque a anotação do tipo de retorno é a classe (ou uma subclasse de) `Response`.
    
    E as ferramentas também ficarão felizes porque `RedirectResponse` e ​​`JSONResponse` são subclasses de `Response`, então a anotação de tipo está correta.
    
    ### Anote uma subclasse de Response { #annotate-a-response-subclass }
    
    Você também pode usar uma subclasse de `Response` na anotação de tipo:
    
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Dec 17 20:41:43 GMT 2025
    - 17.3K bytes
    - Click Count (0)
Back to Top