Search Options

Results per page
Sort
Preferred Languages
Advance

Results 521 - 530 of 603 for Statuscode (0.04 sec)

  1. tests/test_get_model_definitions_formfeed_escape.py

            )
    
        client = TestClient(app)
        return client
    
    
    def test_get(client: TestClient):
        response = client.get("/facilities/42")
        assert response.status_code == 200, response.text
        assert response.json() == {
            "id": "42",
            "address": {
                "line_1": "123 Main St",
                "city": "Anytown",
                "state_province": "CA",
            },
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 5.8K bytes
    - Viewed (0)
  2. tests/test_additional_responses_custom_validationerror.py

    )
    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"},
            "paths": {
                "/a/{id}": {
                    "get": {
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 21:25:59 UTC 2025
    - 2.9K bytes
    - Viewed (0)
  3. docs_src/app_testing/tutorial004_py39.py

            assert items == {"foo": {"name": "Fighters"}, "bar": {"name": "Tenders"}}
    
            response = client.get("/items/foo")
            assert response.status_code == 200
            assert response.json() == {"name": "Fighters"}
    
            # After the requests is done, the items are still there
            assert items == {"foo": {"name": "Fighters"}, "bar": {"name": "Tenders"}}
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 1.2K bytes
    - Viewed (0)
  4. tests/test_additional_responses_default_validationerror.py

    
    @app.get("/a/{id}")
    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"},
            "paths": {
                "/a/{id}": {
                    "get": {
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 2.8K bytes
    - Viewed (0)
  5. tests/test_dependency_after_yield_streaming.py

    
    def test_broken_session_data_no_raise():
        client = TestClient(app, raise_server_exceptions=False)
        response = client.get("/broken-session-data")
        assert response.status_code == 500
        assert response.text == "Internal Server Error"
    
    
    def test_broken_session_stream_raise():
        # Can raise ValueError on Pydantic v2 and ExceptionGroup on Pydantic v1
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 21:25:59 UTC 2025
    - 3.2K bytes
    - Viewed (0)
  6. docs/es/docs/advanced/response-change-status-code.md

    ## Usa un parĂ¡metro `Response` { #use-a-response-parameter }
    
    Puedes declarar un parĂ¡metro de tipo `Response` en tu *path operation function* (como puedes hacer para cookies y headers).
    
    Y luego puedes establecer el `status_code` en ese objeto de response *temporal*.
    
    {* ../../docs_src/response_change_status_code/tutorial001_py39.py hl[1,9,12] *}
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 1.7K bytes
    - Viewed (0)
  7. tests/test_request_params/test_path/test_required_str.py

                id="required-alias-and-validation-alias",
            ),
        ],
    )
    def test_success(path: str):
        client = TestClient(app)
        response = client.get(f"{path}/hello")
        assert response.status_code == 200, response.text
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 20 15:55:38 UTC 2025
    - 2.3K bytes
    - Viewed (0)
  8. docs_src/custom_response/tutorial006c_py39.py

    from fastapi import FastAPI
    from fastapi.responses import RedirectResponse
    
    app = FastAPI()
    
    
    @app.get("/pydantic", response_class=RedirectResponse, status_code=302)
    async def redirect_pydantic():
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 237 bytes
    - Viewed (0)
  9. tests/test_filter_pydantic_sub_model_pv2.py

            }
    
        client = TestClient(app)
        return client
    
    
    def test_filter_sub_model(client: TestClient):
        response = client.get("/model/modelA")
        assert response.status_code == 200, response.text
        assert response.json() == {
            "name": "modelA",
            "description": "model-a-desc",
            "foo": {"username": "test-user"},
            "tags": {"key1": "value1", "key2": "value2"},
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 6.6K bytes
    - Viewed (0)
  10. docs_src/app_testing/tutorial001_py39.py

    app = FastAPI()
    
    
    @app.get("/")
    async def read_main():
        return {"msg": "Hello World"}
    
    
    client = TestClient(app)
    
    
    def test_read_main():
        response = client.get("/")
        assert response.status_code == 200
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 334 bytes
    - Viewed (0)
Back to top