> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kasoftware.com/llms.txt
> Use this file to discover all available pages before exploring further.

# arc:script

> 使用 arc:script 创建响应特定 REST 方法的脚本块，从而在 ArcScript 中启用类 REST 服务。

export const siteNameShort = "知行之桥";

`arc:script` 关键字可用于创建响应 REST 方法的脚本块。

## 参数

* **method**：用于调用脚本的 HTTP 方法（GET、POST、PUT/PATCH/MERGE 或 DELETE）。可以指定多个方法，以逗号分隔。这可用于在 {siteNameShort}Script 中创建类 REST 服务。
* **language**：编写脚本时是否使用 Python 脚本语言。详情请参阅[编写 Python](../writing-python)。

## 控制属性

无

## 示例

以下脚本定义了 `GetTransmissionDetails` 服务。只有使用 POST 方法访问 `GetTransmissionDetails` 时，该脚本才会执行。输入参数在 HTTP 请求的主体中定义。

```xml theme={null}
<arc:script xmlns:arc="http://www.arcesb.com/ns/ArcScript/2">
  
  <arc:restrict user="admin" role="Administrators"/>
  
  <arc:info title="GetTransmissionDetails" description="Retrieves the transmission details of the application.">
    <input name="ConnectorId"          desc="The id of the connector." required="true"/>
    <input name="MessageId"       desc="The message Id." required="true"/>
    <input name="Direction"       desc="The direction of the transmission." values="Incoming,Outgoing" required="true"/>
    <output name="LogTimeCreated" desc="The time the log file was created."/>
    <output name="LogType"        desc="The type of the log file." />
    <output name="LogFile"        desc="The name of the log file." />
    <output name="LogPath"        desc="The path of the log file." />
  </arc:info>

  <arc:script method="POST">
    <arc:push op="portGetTransmissionDetails" />
  </arc:script>
</arc:script>
```
