Closed MysticEyeBlink closed 2 years ago
This has been released in v0.5.1!
Make sure to always update to the latest version (npm i @mswjs/http-middleware@latest
) to get the newest features and bug fixes.
Predictable release automation by @ossjs/release.
Making POST request with JSON body, to mocked endpoint, produces body value as
[object Object]
. The cause of this lays on usingexpress.json()
and then non-stringified JSON is changed to ArrayBuffer increateMiddleware
.Parsing text to JSON: https://github.com/mswjs/http-middleware/blob/ca849760dd3e32e990d33d66d393c101e5dc1f02/src/server.ts#L8
Encoding non-stringified JSON: https://github.com/mswjs/http-middleware/blob/ca849760dd3e32e990d33d66d393c101e5dc1f02/src/middleware.ts#L22