Rasel Hossain
Rasel Hossain7mo ago

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
No description
7 Replies
Sandvich
Sandvich7mo ago
I think you need /api/trpc/subscription.updateSubscription?batch=1
body: {
0: {
json: {
data:
....
body: {
0: {
json: {
data:
....
if you check your browser devtools you'll see that's how trpc sends requests
Sandvich
Sandvich7mo ago
No description
No description
Rasel Hossain
Rasel Hossain6mo ago
thanks Sandvich
Rasel Hossain
Rasel Hossain6mo ago
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
Rasel Hossain
Rasel Hossain6mo ago
@Sandvich
Sandvich
Sandvich6mo ago
No idea what Qstash is or how it works. Probably best reading their documentation
Rasel Hossain
Rasel Hossain6mo ago
I have already read it, but I did not find any solution.