<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                **頂級的JSON對象可能包含下面這些屬性** ### [](https://github.com/darcyliu/google-styleguide/blob/master/JSONStyleGuide.md#apiversion)apiVersion ~~~ 屬性值類型: 字符串(string) 父節點: - ~~~ 呈現請求中服務API期望的版本,以及在響應中保存的服務API版本。應隨時提供_apiVersion_。這與數據的版本無關。將數據版本化應該通過其他的機制來處理,如etag。 示例: ~~~ { "apiVersion": "2.1" } ~~~ ### [](https://github.com/darcyliu/google-styleguide/blob/master/JSONStyleGuide.md#context)context ~~~ 屬性值類型: 字符串(string) 父節點: - ~~~ 客戶端設置這個值,服務器通過數據作出回應。這在JSON-P和批處理中很有用,用戶可以使用_context_將響應與請求關聯起來。該屬性是頂級屬性,因為不管響應是成功還是有錯誤,_context_總應當被呈現出來。_context_不同于_id_在于_context_由用戶提供而_id_由服務分配。 示例: 請求 #1: ~~~ http://www.google.com/myapi?context=bart ~~~ 請求 #2: ~~~ http://www.google.com/myapi?context=lisa ~~~ 響應 #1: ~~~ { "context": "bart", "data": { "items": [] } } ~~~ 響應 #2: ~~~ { "context": "lisa", "data": { "items": [] } } ~~~ 公共的JavaScript處理器通過編碼同時處理以下兩個響應: ~~~ function handleResponse(response) { if (response.result.context == "bart") { // 更新頁面中的 "Bart" 部分。 } else if (response.result.context == "lisa") { // 更新頁面中的 "Lisa" 部分。 } } ~~~ ### [](https://github.com/darcyliu/google-styleguide/blob/master/JSONStyleGuide.md#id)id ~~~ 屬性值類型: 字符串(string) 父節點: - ~~~ 服務提供用于識別響應的標識(無論請求是成功還是有錯誤)。這對于將服務日志和單獨收到的響應對應起來很有用。 示例: ~~~ { "id": "1" } ~~~ ### [](https://github.com/darcyliu/google-styleguide/blob/master/JSONStyleGuide.md#method)method ~~~ 屬性值類型: 字符串(string) 父節點: - ~~~ 表示對數據即將執行,或已被執行的操作。在JSON請求的情況下,_method_屬性可以用來指明對數據進行何種操作。在JSON響應的情況下,_method_屬性表明對數據進行了何種操作。 一個JSON-RPC請求的例子,其中_method_屬性表示要在_params_上執行的操作: ~~~ { "method": "people.get", "params": { "userId": "@me", "groupId": "@self" } } ~~~ ### [](https://github.com/darcyliu/google-styleguide/blob/master/JSONStyleGuide.md#params)params ~~~ 屬性值類型: 對象(object) 父節點: - ~~~ 這個對象作為輸入參數的映射發送給RPC請求。它可以和_method_屬性一起用來執行RPC功能。若RPC方法不需要參數,則可以省略該屬性。 示例: ~~~ { "method": "people.get", "params": { "userId": "@me", "groupId": "@self" } } ~~~ ### [](https://github.com/darcyliu/google-styleguide/blob/master/JSONStyleGuide.md#data)data ~~~ 屬性值類型: 對象(object) 父節點: - ~~~ 包含響應的所有數據。該屬性本身擁有許多保留屬性名,下面會有相應的說明。服務可以自由地將自己的數據添加到這個對象。一個JSON響應要么應當包含一個_data_對象,要么應當包含_error_對象,但不能兩者都包含。如果_data_和_error_同時出現,則_error_對象優先。 ### [](https://github.com/darcyliu/google-styleguide/blob/master/JSONStyleGuide.md#error)error ~~~ 屬性值類型: 對象(object) 父節點: - ~~~ 表明錯誤發生,提供錯誤的詳細信息。錯誤的格式支持從服務返回一個或多個錯誤。一個JSON響應可以有一個_data_對象或者一個_error_對象,但不能兩者都包含。如果_data_和_error_都出現,_error_對象優先。 示例: ~~~ { "apiVersion": "2.0", "error": { "code": 404, "message": "File Not Found", "errors": [{ "domain": "Calendar", "reason": "ResourceNotFoundException", "message": "File Not Found }] } } ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看