Реклама
Make Batch Requests With The REST APIs | Microsoft Docs
28-09-2022, 03:57 | Автор: BOWJoshua0 | Категория: Хип-хоп
Make Batch Requests With The REST APIs | Microsoft DocsMake batch requests with the REST APIs.
This article describes how you can batch queries and operations against the REST/OData API of Microsoft SharePoint Online (and on-premises SharePoint 2016 and later) and the Files and folders subset of the Office 365 REST APIs. With this technique, you can improve the performance of your add-in by combining many operations into a single request to the server and a single response back.
Executive summary of the $batch option.
SharePoint Online (and on-premises SharePoint 2016 and later) and the Office 365 APIs implement the OData $batch query option, so you can rely on the official documentation for Binary Options details about how to use it. (Another option is to see Andrew Connell's blog posts on the subject beginning at Part 1 - SharePoint REST API Batching.)
The following is a reminder of the major points:
The request URL consists of the root service URL and the $batch option; for example, https://fabrikam.sharepoint.com/_api/$batch or https://fabrikam.office365.com/api/v1.0/me/$batch . The HTTP request body is MIME type multipart/mixed . The body of the request is divided into parts that are separated from each other by a boundary string that is specified in the header of the request. Each part of the body has its own HTTP verb and REST URL, and its own internal body when applicable. A part can be a read operation (or function invocation), or a ChangeSet of one or more write operations (or Binary Options function invocations). A ChangeSet is itself a MIME type multipart/mixed with subparts that contain insert, update, or delete operations.
SharePoint and Office 365 APIs aren't transactional and Po.Cash don't support "all or nothing" functionality for ChangeSets that have more than one operation within them. If any of the child operations fails, the others still complete and aren't rolled back.
Code samples.
Samples of code that uses the $batch query option against the SharePoint REST/OData APIs:
C#: OfficeDev/Core.ODataBatch javascript: andrewconnell/sp-o365-rest.
Example requests and responses.
The following is an example of a raw HTTP request that batches two GET operations that retrieve the titles of all the items in two different lists.
The following is an example of the body of a raw HTTP request that batches a DELETE of a list and a GET of the SharePoint list-of-lists.
Batch requests can reduce the number of round-trip requests to the SharePoint REST API. However, uploading multiple files in a single batch is not supported.
OData libraries.
OData libraries support OData batching for Binary Options many languages. Following are two examples. For a more complete list, see OData Libraries.
Скачать Skymonk по прямой ссылке
Просмотров: 12  |  Комментариев: (0)
Уважаемый посетитель, Вы зашли на сайт kopirki.net как незарегистрированный пользователь.
Мы рекомендуем Вам зарегистрироваться либо войти на сайт под своим именем.