[comment]: # translation:outdated

[comment]: # ({3ab1bd41-c289fd9d})
# 更新

[comment]: # ({/3ab1bd41-c289fd9d})

[comment]: # ({e14401cf-a9f5fcd6})
### 说明

`object httptest.update(object/array webScenarios)`

此方法允许更新现有的Web场景。

[comment]: # ({/e14401cf-a9f5fcd6})

[comment]: # ({072f83cd-44af8f8c})
### 参数

`(object/array)`要更新的Web场景属性。

必须为每个Web场景定义`httptestid`属性，所有其他属性都是可选的。
只有通过的属性将被更新，所有其他属性将保持不变
除了[标准Web场景属性](object#web_scenario)外, 该方法接受以下参数。

|参数    类|说明|<|
|-------------|------|-|
|steps|array|用来替代现有的步骤的方案步骤。|

[comment]: # ({/072f83cd-44af8f8c})

[comment]: # ({e6bb35b2-02282fdb})
### 返回值

`(object)` 返回一个对象，该对象包含`httptestid`属性下更新的web场景的ID。

[comment]: # ({/e6bb35b2-02282fdb})

[comment]: # ({4811a99c-b41637d2})
### 示例

[comment]: # ({/4811a99c-b41637d2})

[comment]: # ({fe7789af-4c3bf00e})
#### 启用Web方案

启用Web方案，即将其状态设置为“0”。

Request:

``` {.java}
{
    "jsonrpc": "2.0",
    "method": "httptest.update",
    "params": {
        "httptestid": "5",
        "status": 0
    },
    "auth": "700ca65537074ec963db7efabda78259",
    "id": 1
}
```

Response:

``` {.java}
{
    "jsonrpc": "2.0",
    "result": {
        "httptestids": [
            "5"
        ]
    },
    "id": 1
}
```

[comment]: # ({/fe7789af-4c3bf00e})

[comment]: # ({cdf778cd-e8ca015f})
### 参考

-   [场景步骤](object#场景步骤)

[comment]: # ({/cdf778cd-e8ca015f})

[comment]: # ({45b5214c-628fc1ff})
### 来源

CHttpTest::update() in
*frontends/php/include/classes/api/services/CHttpTest.php*.

[comment]: # ({/45b5214c-628fc1ff})
