自 2025 年 3 月 27 日起,我們建議您使用 android-latest-release
而非 aosp-main
建構及貢獻 AOSP。詳情請參閱「Android 開放原始碼計畫變更」。
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
IRestApiHelper
public
interface
IRestApiHelper
com.android.tradefed.util.IRestApiHelper
|
用於執行 REST API 呼叫的輔助介面。
摘要
公用方法 |
abstract
HttpResponse
|
execute(String method, String[] uriParts, options, JSONObject data)
執行 API 要求。
|
公用方法
執行
public abstract HttpResponse execute (String method,
String[] uriParts,
options,
JSONObject data)
執行 API 要求。
參數 |
method |
String :要求的 HTTP 方法 |
uriParts |
String :用於建構要求 URI 的網址編碼 URI 部分。 |
options |
:用於建構查詢字串的未經編碼參數名稱和值 |
data |
JSONObject :要隨要求傳送的資料 |
傳回 |
HttpResponse |
HttpResponse 物件 |
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2025-07-27 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-07-27 (世界標準時間)。"],[],[],null,["# IRestApiHelper\n==============\n\n\n`\npublic\n\n\ninterface\nIRestApiHelper\n`\n\n\n`\n\n\n`\n\n|------------------------------------------|\n| com.android.tradefed.util.IRestApiHelper |\n\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known indirect subclasses [RestApiHelper](../../../../../../reference/tradefed/com/android/tradefed/util/RestApiHelper.html) |----------------------------------------------------------------------------------------------------|-----------------------------------------------| | [RestApiHelper](../../../../../../reference/tradefed/com/android/tradefed/util/RestApiHelper.html) | A helper class for performing REST API calls. | |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nA helper interface for performing REST API calls.\n\nSummary\n-------\n\n| ### Public methods ||\n|--------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract HttpResponse` | ` `[execute](../../../../../../reference/tradefed/com/android/tradefed/util/IRestApiHelper.html#execute(java.lang.String,%20java.lang.String[],%20\u003cany\u003e,%20org.json.JSONObject))`(String method, String[] uriParts, ` options, JSONObject data) Executes an API request. |\n\nPublic methods\n--------------\n\n### execute\n\n```\npublic abstract HttpResponse execute (String method, \n String[] uriParts, \n options, \n JSONObject data)\n```\n\nExecutes an API request.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|------------|----------------------------------------------------------------------------------|\n| `method` | `String`: a HTTP method of the request \u003cbr /\u003e |\n| `uriParts` | `String`: URL encoded URI parts to be used to construct the request URI. \u003cbr /\u003e |\n| `options` | : unencoded parameter names and values used to construct the query string \u003cbr /\u003e |\n| `data` | `JSONObject`: data to be sent with the request \u003cbr /\u003e |\n\n| Returns ||\n|----------------|------------------------------|\n| `HttpResponse` | a HttpResponse object \u003cbr /\u003e |\n\n| Throws ||\n|---|-------------|\n| | IOException |"]]