---
url: /nestjs-odata/api/generated/functions/parseBatchBody.md
---
# Function: parseBatchBody()

> **parseBatchBody**(`body`, `boundary`): [`ParsedBatch`](../interfaces/ParsedBatch.md)

Defined in: [batch/batch-parser.ts:61](https://github.com/cberd1509/nestjs-odata/blob/a42974292d62fe5da337a603d3b22d57c08cbf68/packages/core/src/batch/batch-parser.ts#L61)

Parse a multipart/mixed batch body into structured BatchPart objects.

Handles:

* Individual request parts (kind: 'request')
* Changesets (kind: 'changeset') containing sub-request parts
* Both CRLF (\r\n) and LF (\n) line endings
* Content-ID headers for changeset sub-parts
* Embedded HTTP request parsing (METHOD URL HTTP/1.1, headers, body)

Per T-05-02: rejects batches exceeding MAX_BATCH_OPERATIONS operations.

## Parameters

### body

`string`

The raw request body string

### boundary

`string`

The multipart boundary (from extractBoundary())

## Returns

[`ParsedBatch`](../interfaces/ParsedBatch.md)

ParsedBatch with all parsed parts

## Throws

ODataValidationError if body is malformed or exceeds limits
