How to get the Request Body data of QStash
Hello everyone. I'm currently working on a client project that involves using trpc with Next.js. We're using Qstash as our message queue service, and I'm trying to publish a message to updateSubscription procedure. However, Qstash only supports POST requests. So, I created a mutation procedure in the trpc server. My question is, how can I receive the body data in the trpc procedure? I tried using input, but it seems like Qstash can't send the request. Could anyone please guide me on how to tackle this issue?
7 Replies
I think you need
/api/trpc/subscription.updateSubscription?batch=1
if you check your browser devtools you'll see that's how trpc sends requeststhanks Sandvich
There is an issue with Qstash publishing messages. It injects some headers in the request headers when publishing the message. Although I can see the input value, I am unable to view the request headers. Can you please guide me on how to access the request headers?
@Sandvich
No idea what Qstash is or how it works. Probably best reading their documentation
I have already read it, but I did not find any solution.