HTTP 監視 API 參考HTTP Monitor API reference

您可以使用此 API 存取焦點應用程式的即時 HTTP 流量,如果 Xbox 主機上已啟用 HTTP 監視 (開發人員首頁中核取方塊)。You can access real-time HTTP traffic for the focused app using this API if the HTTP monitor has been enabled on the Xbox console by checking the box in Dev Home.

取得是否啟用 HTTP 監視Get if the HTTP Monitor is enabled

要求Request

您可以在開發人員首頁取得是否已啟用的 HTTP 監視。You can get whether the HTTP monitor has been enabled in Dev Home.

方法Method 要求 URIRequest URI
GETGET /ext/httpmonitor/sessions/ext/httpmonitor/sessions

URI 參數URI parameters

  • None

要求標頭Request headers

  • None

要求本文Request body

  • None

回應 Response
JSON 物件,包含下列欄位:A JSON object with the following fields:

  • Enabled - (Bool) Xbox 主機上是否已啟用 HTTP 監視,透過在開發人員首頁中核取方塊。Enabled - (Bool) Whether the HTTP monitor has been enabled on the Xbox console by checking the box in Dev Home.

狀態碼Status code

此 API 具有下列預期狀態碼。This API has the following expected status codes.

HTTP 狀態碼HTTP status code 描述Description
200200 要求成功Request was successful
4XX4XX 錯誤碼Error codes
5XX5XX 錯誤碼Error codes

取得來自焦點應用程式的 HTTP 流量Get HTTP traffic from the focused app

要求Request

在 Xbox 上即時取得來自焦點應用程式的 HTTP 流量,只要它不是系統應用程式,如果已從開發人員首頁啟用 HTTP 監視。Get HTTP traffic from the focused app on the Xbox, as long as it is not a system app, in real-time, if the HTTP monitor has been enabled from Dev Home.

方法Method 要求 URIRequest URI
WebsocketWebsocket /ext/httpmonitor/sessions/ext/httpmonitor/sessions

URI 參數URI parameters

  • None

要求標頭Request headers

  • None

要求本文Request body

  • None

回應 Response
JSON 物件,包含下列欄位:A JSON object with the following fields:

  • 工作階段Sessions
    • RequestHeaders - (JSON 物件) HTTP 要求的要求標頭。RequestHeaders - (JSON Object) The request headers from the HTTP Request.
    • RequestContentHeaders - (JSON 物件) HTTP 要求的要求內容標頭。RequestContentHeaders - (JSON Object) The request content headers from the HTTP Request.
    • RequestURL -(字串)要求 URL。RequestURL - (String) The request URL.
    • RequestMethod -(字串)要求方法。RequestMethod - (String) The request method.
    • RequestMessage -(字串)要求訊息,目前僅支援 JSON 和文字內容。RequestMessage - (String) The request message, currently only supporting JSON and text content.
    • ResponseHeaders -(JSON 物件)HTTP 回應的回應標頭。ResponseHeaders - (JSON Object) The response headers from the HTTP Response.
    • ResponseContentHeaders -(JSON 物件)HTTP 回應的回應內容標頭。ResponseContentHeaders - (JSON Object) The response content headers from the HTTP Response.
    • StatusCode - (數字) 回應狀態碼。StatusCode - (Number) The response status code.
    • ReasponsePhrase -(字串)回應原因句子。ReasponsePhrase - (String) The response reason phrase.
    • ResponseMessage -(字串)回應訊息,目前僅支援 JSON 和文字內容。ResponseMessage - (String) The response message, currently only supporting JSON and text content.

狀態碼Status code

此 API 具有下列預期狀態碼。This API has the following expected status codes.

HTTP 狀態碼HTTP status code 描述Description
200200 要求成功Request was successful
4XX4XX 錯誤碼Error codes
403403 HTTP 監視停用,必須在開發人員首頁中啟用HTTP Monitor disabled, must be enabled in Dev Home
5XX5XX 錯誤碼Error codes

可用裝置系列Available device families

  • Windows XboxWindows Xbox