Path: API › 网站管理

`POST /site`

设置网站的到期时间。到期后网站将自动停止。

## Request body

_Required._

- `action262.request_time` (string, required) — Unix 时间戳。
- `action262.request_token` (string, required) — 按 API 概览生成的签名。
- `action262.action` (string, required) — 具体操作名称。
  - one of `"SetEdate"`
- `action262.id` (integer, required) — 网站 ID
- `action262.edate` (string, required) — 到期日期，`0000-00-00` 表示永久有效

## Example request

```text
{
  "request_time": "string",
  "request_token": "string",
  "action": "SetEdate",
  "id": 0,
  "edate": "string"
}
```

## Code samples

### cURL（填写面板地址与签名）

```curl
curl --request POST \
  --url "https://your-panel.example.com:8888/site" \
  --header "Content-Type: application/x-www-form-urlencoded" \
  --data-urlencode "request_time=<Unix时间戳>" \
  --data-urlencode "request_token=<按 API 概览生成的签名>" \
  --data-urlencode "action=SetEdate" \
  --data-urlencode "id=<id>" \
  --data-urlencode "edate=<edate>"
```

## Responses

### default

接口响应，业务状态见下方详细说明。

#### Example

```json
{
  "status": true,
  "msg": "设置成功,站点到期后将自动停止!"
}
```

- `action262.response.default.status` (boolean, optional) — `true` 表示设置成功
- `action262.response.default.msg` (string, optional) — 提示信息


## SetEdate

设置网站的到期时间。到期后网站将自动停止。

- **路由**：`POST /site`
- **action**：`SetEdate`

## 输入参数

| 参数名称 | 必选 | 类型 | 描述 |
|----------|------|------|------|
| action | 是 | String | 固定值 `SetEdate` |
| id | 是 | Integer | 网站 ID |
| edate | 是 | String | 到期日期，`0000-00-00` 表示永久有效 |

## 输出参数

| 参数名称 | 类型 | 描述 |
|----------|------|------|
| status | Boolean | `true` 表示设置成功 |
| msg | String | 提示信息 |

## 示例

### 请求

```
POST /site HTTP/1.1
Content-Type: application/x-www-form-urlencoded

action=SetEdate&id=1&edate=0000-00-00
```

### 响应

```json
{"status": true, "msg": "设置成功,站点到期后将自动停止!"}
```

