Incoming request body has been parsed as [object Object]
MysticEyeBlink opened this issue · comments
Making POST request with JSON body, to mocked endpoint, produces body value as [object Object]
.
The cause of this lays on using express.json()
and then non-stringified JSON is changed to ArrayBuffer in createMiddleware
.
Parsing text to JSON:
Line 8 in ca84976
Encoding non-stringified JSON:
http-middleware/src/middleware.ts
Line 22 in ca84976
Released: v0.5.1 🎉
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.