Set the REST batch size using the following option headers:
batchSize — A numeric value that specifies the number of records returned for a query request. Child objects count toward the number of records for the batch size. For example, in relationship queries, multiple child objects may be returned per parent row returned. The default is 2,000; the minimum is 200, and the maximum is 2,000. There is no guarantee that the requested batch size will be the actual batch size; this is done to maximize performance.
Want to learn Salesforce in depth? Go through the Salesforce Training provided by Intellipaat!