src/sap.ui.core/src/sap/ui/model/odata/v4/lib/_Batch.js
function (aRequests) {
			var oBatchRequest = _serializeBatchRequest(aRequests);

			return {
				body : oBatchRequest.body.join(""),
				headers : {
					"Content-Type" : "multipart/mixed; boundary=" + oBatchRequest.batchBoundary,
					"MIME-Version" : "1.0"
				}
			};
		}
function (aRequests) {
			var oBatchRequest = _serializeBatchRequest(aRequests);

			return {
				body : oBatchRequest.body.join(""),
				headers : {
					"Content-Type" : "multipart/mixed; boundary=" + oBatchRequest.batchBoundary,
					"MIME-Version" : "1.0"
				}
			};
		}
function ( aRequests ) { var oBatchRequest = _serializeBatchRequest ( aRequests ) ; return { body : oBatchRequest . body . join ( "" ) , headers : { "Content-Type" : "multipart/mixed; boundary=" + oBatchRequest . batchBoundary , "MIME-Version" : "1.0" } } ; }
Serializes an array of requests to an object containing the batch request body and
mandatory headers for the batch request.

@param {object[]} aRequests
An array consisting of request objects <code>oRequest</code> or out of array(s)
of request objects <code>oRequest</code>, in case requests need to be sent in scope of
a change set. See example below.
@param {string} oRequest.method
HTTP method, e.g. "GET"
@param {string} oRequest.url
Absolute or relative URL. If the URL contains Content-ID reference then the reference
has to be specified as zero-based index of the referred request inside the change set.
See example below.
@param {object} oRequest.headers
Map of request headers. RFC-2047 encoding rules are not supported. Nevertheless non
US-ASCII values can be used. If the value of an "If-Match" header is an object, that
object's ETag is used instead.
@param {object} oRequest.body
Request body. If specified, oRequest.headers map must contain "Content-Type" header
either without "charset" parameter or with "charset" parameter having value "UTF-8".
@returns {object} Object containing the following properties:
<ul>
<li><code>body</code>: Batch request body
<li><code>headers</code>: Batch-specific request headers
<ul>
<li><code>Content-Type</code>: Value for the 'Content-Type' header
<li><code>MIME-Version</code>: Value for the 'MIME-Version' header
</ul>
</ul>
@example
var oBatchRequest = Batch.serializeBatchRequest([
{
method : "GET",
url : "/sap/opu/odata4/IWBEP/TEA/default/IWBEP/TEA_BUSI/0001/Employees('1')",
headers : {
Accept : "application/json"
}
},
[{
method : "POST",
url : "TEAMS",
headers : {
"Content-Type" : "application/json"
},
body : {"TEAM_ID" : "TEAM_03"}
}, {
method : "POST",
url : "$0/TEAM_2_Employees",
headers : {
"Content-Type" : "application/json",
"If-Match" : "etag0"
},
body : {"Name" : "John Smith"}
}],
{
method : "PATCH",
url : "/sap/opu/odata4/IWBEP/TEA/default/IWBEP/TEA_BUSI/0001/Employees('3')",
headers : {
"Content-Type" : "application/json",
"If-Match" : {
"@odata.etag" : "etag1"
}
},
body : {"TEAM_ID" : "TEAM_01"}
}
]);
Serializes an array of requests to an object containing the batch request body and mandatory headers for the batch request .