> ## 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）。可以指定多個方法，以逗號分隔。這可用於在 ArcScript 中建立類 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>
```
