Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 3,340 for _code (0.25 sec)

  1. tests/test_response_code_no_body.py

    client = TestClient(app)
    
    
    def test_get_response():
        response = client.get("/a")
        assert response.status_code == 204, response.text
        assert "content-length" not in response.headers
        assert response.content == b""
    
    
    def test_openapi_schema():
        response = client.get("/openapi.json")
        assert response.status_code == 200, response.text
        assert response.json() == {
            "openapi": "3.1.0",
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 3.2K bytes
    - Viewed (0)
  2. tests/test_security_oauth2_authorization_code_bearer.py

    
    def test_no_token():
        response = client.get("/items")
        assert response.status_code == 401, response.text
        assert response.json() == {"detail": "Not authenticated"}
    
    
    def test_incorrect_token():
        response = client.get("/items", headers={"Authorization": "Non-existent testtoken"})
        assert response.status_code == 401, response.text
        assert response.json() == {"detail": "Not authenticated"}
    
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 2.3K bytes
    - Viewed (0)
  3. tests/test_reponse_set_reponse_code_empty.py

    
    @app.delete(
        "/{id}",
        status_code=204,
        response_model=None,
    )
    async def delete_deployment(
        id: int,
        response: Response,
    ) -> Any:
        response.status_code = 400
        return {"msg": "Status overwritten", "id": id}
    
    
    client = TestClient(app)
    
    
    def test_dependency_set_status_code():
        response = client.delete("/1")
        assert response.status_code == 400 and response.content
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 3.1K bytes
    - Viewed (0)
  4. tests/test_security_oauth2_authorization_code_bearer_description.py

        response = client.get("/items", headers={"Authorization": "Non-existent testtoken"})
        assert response.status_code == 401, response.text
        assert response.json() == {"detail": "Not authenticated"}
    
    
    def test_token():
        response = client.get("/items", headers={"Authorization": "Bearer testtoken"})
        assert response.status_code == 200, response.text
        assert response.json() == {"token": "testtoken"}
    
    
    def test_openapi_schema():
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 2.4K bytes
    - Viewed (0)
  5. docs/em/docs/tutorial/response-status-code.md

    🎏 🌌 👆 💪 ✔ 📨 🏷, 👆 💪 📣 🇺🇸🔍 👔 📟 ⚙️ 📨 ⏮️ 🔢 `status_code` 🙆 *➡ 🛠️*:
    
    * `@app.get()`
    * `@app.post()`
    * `@app.put()`
    * `@app.delete()`
    * ♒️.
    
    ```Python hl_lines="6"
    {!../../../docs_src/response_status_code/tutorial001.py!}
    ```
    
    !!! note
        👀 👈 `status_code` 🔢 "👨‍🎨" 👩‍🔬 (`get`, `post`, ♒️). 🚫 👆 *➡ 🛠️ 🔢*, 💖 🌐 🔢 & 💪.
    
    `status_code` 🔢 📨 🔢 ⏮️ 🇺🇸🔍 👔 📟.
    
    !!! info
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Apr 01 09:26:04 GMT 2023
    - 3.4K bytes
    - Viewed (0)
  6. docs/ko/docs/tutorial/response-status-code.md

    # 응답 상태 코드
    
    응답 모델과 같은 방법으로, 어떤 *경로 작동*이든 `status_code` 매개변수를 사용하여 응답에 대한 HTTP 상태 코드를 선언할 수 있습니다.
    
    * `@app.get()`
    * `@app.post()`
    * `@app.put()`
    * `@app.delete()`
    * 기타
    
    ```Python hl_lines="6"
    {!../../../docs_src/response_status_code/tutorial001.py!}
    ```
    
    !!! note "참고"
        `status_code` 는 "데코레이터" 메소드(`get`, `post` 등)의 매개변수입니다. 모든 매개변수들과 본문처럼 *경로 작동 함수*가 아닙니다.
    
    `status_code` 매개변수는 HTTP 상태 코드를 숫자로 입력받습니다.
    
    !!! info "정보"
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu May 12 00:06:16 GMT 2022
    - 4.8K bytes
    - Viewed (0)
  7. docs/ru/docs/tutorial/response-status-code.md

    Вы можете задать HTTP код статуса ответа с помощью параметра `status_code` подобно тому, как вы определяете схему ответа в любой из *операций пути*:
    
    * `@app.get()`
    * `@app.post()`
    * `@app.put()`
    * `@app.delete()`
    * и других.
    
    ```Python hl_lines="6"
    {!../../../docs_src/response_status_code/tutorial001.py!}
    ```
    
    !!! note "Примечание"
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Apr 25 18:44:34 GMT 2023
    - 7K bytes
    - Viewed (0)
  8. docs/pt/docs/tutorial/response-status-code.md

    * `@app.get()`
    * `@app.post()`
    * `@app.put()`
    * `@app.delete()`
    * etc.
    
    ```Python hl_lines="6"
    {!../../../docs_src/response_status_code/tutorial001.py!}
    ```
    
    !!! note "Nota"
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Mon Oct 31 16:22:07 GMT 2022
    - 4.3K bytes
    - Viewed (0)
  9. docs/de/docs/tutorial/response-status-code.md

    * `@app.get()`
    * `@app.post()`
    * `@app.put()`
    * `@app.delete()`
    * usw.
    
    ```Python hl_lines="6"
    {!../../../docs_src/response_status_code/tutorial001.py!}
    ```
    
    !!! note "Hinweis"
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Apr 02 02:32:57 GMT 2024
    - 4.7K bytes
    - Viewed (0)
  10. docs/zh/docs/tutorial/response-status-code.md

    与指定响应模型的方式相同,在以下任意*路径操作*中,可以使用 `status_code` 参数声明用于响应的 HTTP 状态码:
    
    * `@app.get()`
    * `@app.post()`
    * `@app.put()`
    * `@app.delete()`
    * 等……
    
    ```Python hl_lines="6"
    {!../../../docs_src/response_status_code/tutorial001.py!}
    ```
    
    !!! note "笔记"
    
        注意,`status_code` 是(`get`、`post` 等)**装饰器**方法中的参数。与之前的参数和请求体不同,不是*路径操作函数*的参数。
    
    `status_code` 参数接收表示 HTTP 状态码的数字。
    
    !!! info "说明"
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 30 22:40:18 GMT 2024
    - 3.7K bytes
    - Viewed (0)
Back to top