ConnectionMessage class

ConnectionMessage 代表傳送至語音服務及從語音服務接收的實作特定訊息。 這些訊息是為了偵錯而提供,不應用於 Azure 認知服務語音服務的生產使用案例。 傳送至語音服務及從語音服務接收的訊息可能會變更,而不需通知。 這包括訊息內容、標頭、承載、排序等。已在 1.11.0 版中新增。

屬性

binaryMessage

取得二進位訊息承載。

isBinaryMessage

檢查 ConnectionMessage 是否為二進位訊息。 另請參閱 GetBinaryMessage () 。

isTextMessage

檢查 ConnectionMessage 是否為簡訊。 另請參閱 IsBinaryMessage () 。

path

訊息路徑。

properties

針對這個 定義的屬性及其值集合。 您可以透過這個集合 (存取訊息標頭,例如「Content-Type」) 。

TextMessage

取得文字訊息承載。 文字訊息內容類型通常是 application/json。 若要判斷其他內容類型,請使用 Properties.GetProperty (「Content-Type」) 。

方法

toString()

傳回表示連接訊息的字串。

屬性詳細資料

binaryMessage

取得二進位訊息承載。

ArrayBuffer binaryMessage

屬性值

ArrayBuffer

isBinaryMessage

檢查 ConnectionMessage 是否為二進位訊息。 另請參閱 GetBinaryMessage () 。

boolean isBinaryMessage

屬性值

boolean

isTextMessage

檢查 ConnectionMessage 是否為簡訊。 另請參閱 IsBinaryMessage () 。

boolean isTextMessage

屬性值

boolean

path

訊息路徑。

string path

屬性值

string

properties

針對這個 定義的屬性及其值集合。 您可以透過這個集合 (存取訊息標頭,例如「Content-Type」) 。

PropertyCollection properties

屬性值

TextMessage

取得文字訊息承載。 文字訊息內容類型通常是 application/json。 若要判斷其他內容類型,請使用 Properties.GetProperty (「Content-Type」) 。

string TextMessage

屬性值

string

方法詳細資料

toString()

傳回表示連接訊息的字串。

function toString(): string

傳回

string