@loopback/docs
Version:
Documentation files rendered at [https://loopback.io](https://loopback.io)
36 lines (23 loc) • 1.25 kB
Markdown
---
lang: en
title: 'API docs: rest.restapplication.bodyparser'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/loopbackio/loopback-next/tree/master/packages/rest
permalink: /doc/en/lb4/apidocs.rest.restapplication.bodyparser.html
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@loopback/rest](./rest.md) > [RestApplication](./rest.restapplication.md) > [bodyParser](./rest.restapplication.bodyparser.md)
## RestApplication.bodyParser() method
Bind a body parser to the server context
<b>Signature:</b>
```typescript
bodyParser(bodyParserClass: Constructor<BodyParser>, address?: BindingAddress<BodyParser>): Binding<BodyParser>;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| bodyParserClass | [Constructor](./context.constructor.md)<!-- --><[BodyParser](./rest.bodyparser.md)<!-- -->> | |
| address | [BindingAddress](./context.bindingaddress.md)<!-- --><[BodyParser](./rest.bodyparser.md)<!-- -->> | Optional binding address |
<b>Returns:</b>
[Binding](./context.binding.md)<!-- --><[BodyParser](./rest.bodyparser.md)<!-- -->>