tRPCttRPC
Powered by
TaylorFayT
tRPC•3y ago•
3 replies
TaylorFay

how to access body in middleware

Hi, I’m using trpc with nextjs. Does anyone know how to access the request’s body in middleware? As per the Request docs, the body can only be accessed once via
await req.json()
await req.json()
. However, if I do that in the middleware, the body is unusable within the trpc procedure.
tRPCJoin
Move Fast & Break Nothing. End-to-end typesafe APIs made easy.
5,015Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

How to access the request body in the onError callback?
Michael SchaufelbergerMMichael Schaufelberger / ❓-help
2y ago
Quick question: how to get mutation body in a middleware, which is for a global logging?
XavierBreadXXavierBread / ❓-help
2y ago
How to Type a Middleware factory?
NeoBeanNNeoBean / ❓-help
3y ago