Performs a batch of identical operations
timeseriesClient_sendBatchRequests.Rd
This method is useful for requesting large amounts of similar data from AQTS, taking advantage of ServiceStack's support for auto-batched requests.
Arguments
- endpoint
The base REST endpoint
- operationName
The name of operation, from the AQTS Metadata page, to perform multiple times. NOT the route, but the operation name.
- operationRoute
The route of the operation
- requests
A collection of individual request objects
- batchSize
Optional batch size (defaults to 100 requests per batch)
- verb
Optional HTTP verb of the operation (defaults to "GET")
Details
http://docs.servicestack.net/auto-batched-requests
When you find that a public API only supports a 1-at-a-time approach, and your code needs to request thousands of items, the sendBatchRequests() method is the one to use.
Examples
if (FALSE) {
# Request info for 3 locations.
# Single-request URL is GET /Publish/v2/GetLocationData?LocationIdentifer=loc1
# Operation name is "LocationDataServiceRequest"
requests = c(list(LocationIdentifier="Loc1"), list(LocationIdentifier="Loc3"), list(LocationIdentifier="Loc3"))
responses = timeseries$sendBatchRequests(timeseries$publishUri,"LocationDataServiceRequest", requests)
}