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?
![No description](https://cdn.answeroverflow.com/1227330731383066747/image.png)
![No description](https://cdn.answeroverflow.com/1227330731903025294/image.png)
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 requests![No description](https://cdn.answeroverflow.com/1227410375062847570/image.png)
![No description](https://cdn.answeroverflow.com/1227410375310315640/image.png)
thanks 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?
![No description](https://cdn.answeroverflow.com/1228373852573405265/image.png)
@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.