Batch requests allow you to group multiple individual requests into a single HTTP request payload.
Typically, a batch request is composed of the following.

Batch Request Method and URI
Batch requests are submitted as a single HTTP POST request to the batch endpoint of a service. They are located at the URL $batch relative to the service root.
1POST https://localhost:50000/b1s/v2/$batch
Batch Request Headers
The batch request needs a Content-Type header set to "multipart/mixed", with a boundary specification as follows:
1Content-Type: multipart/mixed;boundary=<Batch Boundary>
The boundary attribute <Batch Boundary> is a GUID (Globally Unique Identifier) string value. You can form your own value based on the allowed characters mentioned in the MIME (Multipurpose Internet Mail Extensions) document. This boundary attribute is used in the Batch Request Body.
Batch Request Body
The body of a batch request is composed of a series of individual sub-requests, or a series of individual sub-requests enclosed in a change set, represented as a distinct MIME part and separated by the boundary defined in the Content-Type header.
A change set is an atomic unit of works. It means that any failed sub-request in a change set causes the whole change set to be rolled back. Change sets must not contain any GET requests or other change sets.
Change set operations allow you to send multiple HTTP requests in a single payload to fulfill use cases which require rollback on failure.
General Format
123456789101112--<Batch Boundary>
<subrequest-1>
--<Batch Boundary>
<subrequest-2>
--<Batch Boundary>
Content-Type: multipart/mixed;boundary=<Changeset Boundary>
--<Changeset boundary>
<subchangeset-request-1>
--<Changeset boundary>
<subchangeset-request-2>
--<Changeset boundary>--
--<Batch Boundary>--
Batch Response
The response body that is returned to the client depends on the request execute result.
The batch will stop executing once a sub request fails. When there is a failure in the change set, only one response returns for this change set, no matter how many sub requests exist in this change set.
If the request format is not valid, the service returns an HTTP error code: 400 Bad Request, with error info in the body.
If the request format is valid, the service returns an HTTP code: 200 OK (OData Version 4) with the response content. Each sub-request will have a corresponding sub-response in the response body.
General Format
12345678910--<batchresponse>
<response content>
--<batchresponse>
<response content>
--<changesetresponse1>
<Changesetcontent>
--<changesetresponse2>
<Changesetcontent>
--<changesetresponse>--
--<batchresponse>--
Note
You can find more information about the MIME definition on the RFC Editor website.