Search Options

Results per page
Sort
Preferred Languages
Advance

Results 531 - 540 of 603 for Statuscode (0.05 sec)

  1. docs_src/custom_response/tutorial003_py39.py

            <head>
                <title>Some HTML in here</title>
            </head>
            <body>
                <h1>Look ma! HTML!</h1>
            </body>
        </html>
        """
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 394 bytes
    - Viewed (0)
  2. tests/test_tutorial/test_response_headers/test_tutorial002.py

    from docs_src.response_headers.tutorial002_py39 import app
    
    client = TestClient(app)
    
    
    def test_path_operation():
        response = client.get("/headers-and-object/")
        assert response.status_code == 200, response.text
        assert response.json() == {"message": "Hello World"}
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 383 bytes
    - Viewed (0)
  3. docs/ru/docs/advanced/response-change-status-code.md

    ## Использование параметра `Response` { #use-a-response-parameter }
    
    Вы можете объявить параметр типа `Response` в вашей *функции обработки пути* (как и для cookies и HTTP-заголовков).
    
    И затем вы можете установить `status_code` в этом *временном* объекте ответа.
    
    {* ../../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
    - 2.7K bytes
    - Viewed (0)
  4. tests/test_tutorial/test_response_headers/test_tutorial001.py

    from fastapi.testclient import TestClient
    
    from docs_src.response_headers.tutorial001_py39 import app
    
    client = TestClient(app)
    
    
    def test_path_operation():
        response = client.get("/headers/")
        assert response.status_code == 200, response.text
        assert response.json() == {"message": "Hello World"}
        assert response.headers["X-Cat-Dog"] == "alone in the world"
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 431 bytes
    - Viewed (0)
  5. tests/test_tutorial/test_settings/test_app01.py

            "admin_email": "******@****.***",
            "items_per_user": 50,
        }
    
    
    def test_openapi_schema(client: TestClient):
        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": {
                "/info": {
                    "get": {
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Dec 26 10:43:02 UTC 2025
    - 2.2K bytes
    - Viewed (0)
  6. docs/es/docs/advanced/additional-status-codes.md

    Para lograr eso, importa `JSONResponse`, y devuelve tu contenido allí directamente, configurando el `status_code` que deseas:
    
    {* ../../docs_src/additional_status_codes/tutorial001_an_py310.py hl[4,25] *}
    
    /// warning | Advertencia
    
    Cuando devuelves un `Response` directamente, como en el ejemplo anterior, se devuelve directamente.
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Tue Dec 16 16:33:45 UTC 2025
    - 2.1K bytes
    - Viewed (0)
  7. fastapi/security/open_id_connect_url.py

            )
            self.scheme_name = scheme_name or self.__class__.__name__
            self.auto_error = auto_error
    
        def make_not_authenticated_error(self) -> HTTPException:
            return HTTPException(
                status_code=HTTP_401_UNAUTHORIZED,
                detail="Not authenticated",
                headers={"WWW-Authenticate": "Bearer"},
            )
    
        async def __call__(self, request: Request) -> Optional[str]:
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 21:25:59 UTC 2025
    - 3.1K bytes
    - Viewed (0)
  8. docs/zh/docs/advanced/response-change-status-code.md

    但如果数据不存在,你想创建它,并返回一个HTTP状态码为“CREATED”`201`。
    
    但你仍然希望能够使用`response_model`过滤和转换你返回的数据。
    
    对于这些情况,你可以使用一个`Response`参数。
    
    ## 使用 `Response` 参数
    
    你可以在你的*路径操作函数*中声明一个`Response`类型的参数(就像你可以为cookies和头部做的那样)。
    
    然后你可以在这个*临时*响应对象中设置`status_code`。
    
    {* ../../docs_src/response_change_status_code/tutorial001.py hl[1,9,12] *}
    
    然后你可以像平常一样返回任何你需要的对象(例如一个`dict`或者一个数据库模型)。如果你声明了一个`response_model`,它仍然会被用来过滤和转换你返回的对象。
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Mon Nov 18 02:25:44 UTC 2024
    - 1.4K bytes
    - Viewed (0)
  9. docs/fr/docs/advanced/additional-status-codes.md

    Pour y parvenir, importez `JSONResponse` et renvoyez-y directement votre contenu, en définissant le `status_code` que vous souhaitez :
    
    {* ../../docs_src/additional_status_codes/tutorial001.py hl[4,25] *}
    
    /// warning | Attention
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Mon Nov 18 02:25:44 UTC 2024
    - 2.2K bytes
    - Viewed (0)
  10. tests/test_security_scopes_sub_dependency.py

        return TestClient(app)
    
    
    def test_security_scopes_sub_dependency_caching(
        client: TestClient, call_counts: dict[str, int]
    ):
        response = client.get("/")
    
        assert response.status_code == 200
        assert call_counts["get_db_session"] == 1
        assert call_counts["get_current_user"] == 2
        assert call_counts["get_user_me"] == 2
        assert call_counts["get_user_items"] == 1
        assert response.json() == {
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 21:25:59 UTC 2025
    - 2.9K bytes
    - Viewed (0)
Back to top