Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 4,305 for xcode (0.22 sec)

  1. docs/em/docs/advanced/response-change-status-code.md

    & ⤴️ 👆 💪 ⚒ `status_code` 👈 *🔀* 📨 🎚.
    
    ```Python hl_lines="1  9  12"
    {!../../../docs_src/response_change_status_code/tutorial001.py!}
    ```
    
    & ⤴️ 👆 💪 📨 🙆 🎚 👆 💪, 👆 🛎 🔜 ( `dict`, 💽 🏷, ♒️).
    
    & 🚥 👆 📣 `response_model`, ⚫️ 🔜 ⚙️ ⛽ & 🗜 🎚 👆 📨.
    
    **FastAPI** 🔜 ⚙️ 👈 *🔀* 📨 ⚗ 👔 📟 (🍪 & 🎚), & 🔜 🚮 👫 🏁 📨 👈 🔌 💲 👆 📨, ⛽ 🙆 `response_model`.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Apr 01 09:26:04 GMT 2023
    - 1.2K bytes
    - Viewed (0)
  2. docs/zh/docs/advanced/response-change-status-code.md

    你可能之前已经了解到,你可以设置默认的[响应状态码](../tutorial/response-status-code.md){.internal-link target=_blank}。
    
    但在某些情况下,你需要返回一个不同于默认值的状态码。
    
    ## 使用场景
    
    例如,假设你想默认返回一个HTTP状态码为“OK”`200`。
    
    但如果数据不存在,你想创建它,并返回一个HTTP状态码为“CREATED”`201`。
    
    但你仍然希望能够使用`response_model`过滤和转换你返回的数据。
    
    对于这些情况,你可以使用一个`Response`参数。
    
    ## 使用 `Response` 参数
    
    你可以在你的*路径操作函数*中声明一个`Response`类型的参数(就像你可以为cookies和头部做的那样)。
    
    然后你可以在这个*临时*响应对象中设置`status_code`。
    
    ```Python hl_lines="1  9  12"
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Jun 10 20:30:28 GMT 2023
    - 1.4K bytes
    - Viewed (0)
  3. 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)
  4. tests/test_response_change_status_code.py

        response.status_code = 201
    
    
    async def parent_dep(result=Depends(response_status_setter)):
        return result
    
    
    @app.get("/", dependencies=[Depends(parent_dep)])
    async def get_main():
        return {"msg": "Hello World"}
    
    
    client = TestClient(app)
    
    
    def test_dependency_set_status_code():
        response = client.get("/")
        assert response.status_code == 201, response.text
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Apr 08 04:37:38 GMT 2020
    - 589 bytes
    - Viewed (0)
  5. ci/official/code_check_changed_files.sh

    # limitations under the License.
    # ==============================================================================
    source "${BASH_SOURCE%/*}/utilities/setup.sh"
    
    Shell Script
    - Registered: Tue Apr 30 12:39:09 GMT 2024
    - Last Modified: Thu Oct 05 18:41:59 GMT 2023
    - 850 bytes
    - Viewed (0)
  6. 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)
  7. 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)
  8. tests/test_security_oauth2_authorization_code_bearer_description.py

        tokenUrl="token",
        description="OAuth2 Code Bearer",
        auto_error=True,
    )
    
    
    @app.get("/items/")
    async def read_items(token: Optional[str] = Security(oauth2_scheme)):
        return {"token": token}
    
    
    client = TestClient(app)
    
    
    def test_no_token():
        response = client.get("/items")
        assert response.status_code == 401, response.text
    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)
  9. src/cmd/asm/internal/arch/arm.go

    		return true
    	}
    	return false
    }
    
    var bcode = []obj.As{
    	arm.ABEQ,
    	arm.ABNE,
    	arm.ABCS,
    	arm.ABCC,
    	arm.ABMI,
    	arm.ABPL,
    	arm.ABVS,
    	arm.ABVC,
    	arm.ABHI,
    	arm.ABLS,
    	arm.ABGE,
    	arm.ABLT,
    	arm.ABGT,
    	arm.ABLE,
    	arm.AB,
    	obj.ANOP,
    }
    
    // ARMConditionCodes handles the special condition code situation for the ARM.
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Nov 18 17:59:44 GMT 2022
    - 6.1K bytes
    - Viewed (0)
  10. doc/asm.html

    and offsets match.
    On 32-bit systems, the low and high 32 bits of a 64-bit value are distinguished by adding
    a <code>_lo</code> or <code>_hi</code> suffix to the name, as in <code>arg_lo+0(FP)</code> or <code>arg_hi+4(FP)</code>.
    If a Go prototype does not name its result, the expected assembly name is <code>ret</code>.
    </p>
    
    <p>
    HTML
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Tue Nov 28 19:15:27 GMT 2023
    - 36.3K bytes
    - Viewed (0)
Back to top