元編程參考文件

Web 結果

10 個節點

本頁內容 10

錯誤請求

函數

400 Bad Request:客戶端傳送的內容有誤,用 JSON 錯誤說明。

簽名
錯誤請求(錯誤: 文字) -> EndpointResponse
EndpointResponse BadRequest(string error)

參數

名稱型別預設值說明
錯誤文字—

返回

結果EndpointResponse
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
Web 結果
所屬包
網路應用

衝突

函數

409 Conflict:與已有的內容衝突——名稱已被佔用,或所編輯的內容已在此期間被更改。

簽名
衝突(錯誤: 文字) -> EndpointResponse
EndpointResponse Conflict(string error)

參數

名稱型別預設值說明
錯誤文字—

返回

結果EndpointResponse
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
Web 結果
所屬包
網路應用

已建立

函數

201 Created:說明新內容在哪裡,並以 JSON 附上它。

簽名
已建立(位置: 文字, 值: 任意) -> EndpointResponse
EndpointResponse Created(string location, object value)

參數

名稱型別預設值說明
位置文字—它的地址,例如 /todos/3。
值任意—

返回

結果EndpointResponse
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
Web 結果
所屬包
網路應用

禁止存取

函數

403 Forbidden:已知請求來自誰,但不允許其進行此操作。

簽名
禁止存取(訊息: 文字) -> EndpointResponse
EndpointResponse Forbidden(string message = "Forbidden.")

參數

名稱型別預設值說明
訊息文字Forbidden.

返回

結果EndpointResponse
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
Web 結果
所屬包
網路應用

無內容

函數

204 No Content:已完成,沒有要返回的內容。

簽名
無內容() -> EndpointResponse
EndpointResponse NoContent()

返回

結果EndpointResponse
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
Web 結果
所屬包
網路應用

未找到

函數

404 Not Found,附帶 JSON 錯誤。

簽名
未找到(訊息: 文字) -> EndpointResponse
EndpointResponse NotFound(string message = "Not found.")

參數

名稱型別預設值說明
訊息文字Not found.

返回

結果EndpointResponse
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
Web 結果
所屬包
網路應用

成功

函數

200 OK,值以 JSON 傳送;本身已是 JSON 的文字按原樣傳送。

簽名
成功(值: 任意) -> EndpointResponse
EndpointResponse Ok(object value)

參數

名稱型別預設值說明
值任意—

返回

結果EndpointResponse
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
Web 結果
所屬包
網路應用

問題詳情

函數

採用 ASP.NET Core 的 Results.Problem 所寫的 RFC 9457 形式的問題:狀態碼、標題和詳情,型別為 application/problem+json。

簽名
問題詳情 -> EndpointResponse
    狀態碼: 整數
    標題: 文字
    詳情: 文字
EndpointResponse Problem(
    int status,
    string title,
    string detail)

參數

名稱型別預設值說明
狀態碼整數—
標題文字—
詳情文字—

返回

結果EndpointResponse
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
Web 結果
所屬包
網路應用

狀態碼

函數

任意狀態碼,附帶 JSON 正文,用於其他節點沒有對應名稱的應答。

簽名
狀態碼(狀態碼: 整數, 值: 任意) -> EndpointResponse
EndpointResponse Status(int status, object value)

參數

名稱型別預設值說明
狀態碼整數—
值任意—

返回

結果EndpointResponse
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
Web 結果
所屬包
網路應用

未授權

函數

401 Unauthorized:請求沒有說明身份,或說明有誤。

簽名
未授權(訊息: 文字) -> EndpointResponse
EndpointResponse Unauthorized(string message = "Unauthorized.")

參數

名稱型別預設值說明
訊息文字Unauthorized.

返回

結果EndpointResponse
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
Web 結果
所屬包
網路應用