[wp-trac] [WordPress Trac] #50244: Add bulk operation support to the Rest API

WordPress Trac noreply at wordpress.org
Tue Oct 20 19:09:04 UTC 2020


#50244: Add bulk operation support to the Rest API
--------------------------------------+--------------------------------
 Reporter:  andraganescu              |       Owner:  TimothyBlynJacobs
     Type:  feature request           |      Status:  closed
 Priority:  high                      |   Milestone:  5.6
Component:  REST API                  |     Version:  4.4
 Severity:  normal                    |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests  |     Focuses:  performance
--------------------------------------+--------------------------------
Changes (by TimothyBlynJacobs):

 * status:  reviewing => closed
 * resolution:   => fixed


Comment:

 In [changeset:"49252" 49252]:
 {{{
 #!CommitTicketReference repository="" revision="49252"
 REST API: Introduce support for batching API requests.

 A new route is introduced, `batch/v1`, that accepts a list of API requests
 to run. Each request runs in sequence, and the responses are returned in
 the order they've been received.

 Optionally, the `require-all-validate` validation mode can be used to
 first validate each request's parameters and only proceed with processing
 if each request validates successfully.

 By default, the batch size is limited to 25 requests. This can be
 controlled using the `rest_get_max_batch_size` filter. Clients are
 strongly encouraged to discover the maximum batch size supported by the
 server by making an OPTIONS request to the `batch/v1` endpoint and
 inspecting the described arguments.

 Additionally, the two new methods, `match_request_to_handler` and
 `respond_to_request` introduced in [48947] now have a `protected`
 visibility as we don't want to expose the inner workings of the
 `WP_REST_Server::dispatch` API.

 Batching is not currently supported for GET requests.

 Fixes #50244.
 Props andraganescu, zieladam, TimothyBlynJacobs.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/50244#comment:42>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list