http-multipart-body-parser
Automatically parses HTTP requests with content type multipart/form-data
and converts the body into an
object. Also handles gracefully broken JSON as Unsupported Media Type (415 errors)
if used in combination with httpErrorHandler
.
It can also be used in combination with validator so that the content can be validated.
Note: by default this is going to parse only events that contain the header Content-Type
(or content-type
) set to multipart/form-data
. If you want to support different casing for the header name (e.g. Content-type
) then you should use the httpHeaderNormalizer
middleware before this middleware.
Install
To install this middleware you can use NPM:
- npm
- Yarn
- pnpm
npm install --save @middy/http-multipart-body-parser
yarn add @middy/http-multipart-body-parser
pnpm add @middy/http-multipart-body-parser