Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for ZH (0.13 sec)

  1. docs/zh/docs/tutorial/body-updates.md

    # 请求体 - 更新数据
    
    ## 用 `PUT` 更新数据
    
    更新数据请用 <a href="https://developer.mozilla.org/zh-CN/docs/Web/HTTP/Methods/PUT" class="external-link" target="_blank">HTTP `PUT`</a> 操作。
    
    把输入数据转换为以 JSON 格式存储的数据(比如,使用 NoSQL 数据库时),可以使用 `jsonable_encoder`。例如,把 `datetime` 转换为 `str`。
    
    ```Python hl_lines="30-35"
    {!../../../docs_src/body_updates/tutorial001.py!}
    ```
    
    `PUT` 用于接收替换现有数据的数据。
    
    ### 关于更新数据的警告
    
    用 `PUT` 把数据项 `bar` 更新为以下内容时:
    
    ```Python
    {
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 3.6K bytes
    - Viewed (0)
Back to top