您目前查看的是 Google Photos Library API 的舊版說明文件。
關於符合 REST 樣式的 API
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
REST 是一種軟體架構,可提供簡便且一致的資料要求及修改方法。
REST 這個詞是「Representational State Transfer (表現層狀態轉換)」的簡稱。在 Google API 中,這是指使用 HTTP 動詞來擷取及修改 Google 所儲存資料的表示法。
在符合 REST 樣式的系統中,資源會儲存在資料儲存庫中。用戶端向伺服器發出執行特定動作 (例如建立、擷取、更新或刪除資源) 的要求後,伺服器就會執行指定動作並傳回回應 (大多採用指定資源表示法的形式)。
在具備 REST 特性的各種 Google API 中,用戶端會使用 POST
、GET
、PUT
或 DELETE
等 HTTP 動詞來指定動作。接著,該動詞會透過全域唯一的 URI 來指定資源,格式如下:
https://www.googleapis.com/apiName/apiVersion/resourcePath?parameters
由於所有 API 資源都有可供 HTTP 存取的專屬 URI,因此 REST 不僅能夠支援資料快取,也非常適合與網路的分散式基礎架構搭配運作。
您可以在 HTTP 1.1 標準說明文件中找到實用的方法定義;包括 GET
、POST
、PUT
和 DELETE
的規格。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-05-08 (世界標準時間)。
[[["容易理解","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-05-08 (世界標準時間)。"],[[["REST is an architectural style for exchanging data using standard HTTP methods like `GET`, `POST`, `PUT`, and `DELETE`."],["Google APIs implement REST, allowing clients to interact with Google's data by sending HTTP requests to specific resource URIs."],["RESTful systems rely on unique URIs for resources, enabling efficient caching and leveraging web infrastructure."],["Clients request actions on data stored by the server, which then performs the action and responds, often with a representation of the resource."]]],["REST is a software architecture style employing HTTP verbs to interact with data. Clients send requests to servers to perform actions like creating, retrieving, updating, or deleting resources. Resources are identified by unique URIs, structured as `https://www.googleapis.com/apiName/apiVersion/resourcePath?parameters`. The server executes the requested action and responds. Common HTTP verbs used include `POST`, `GET`, `PUT`, and `DELETE`, defining the specific action. This structure supports data caching and is optimized for web infrastructure.\n"]]