jacin
jacin2mo ago

How to try a Post request?

TIL I can't use Postman to try Post requests due to how tRPC handles requests. What can I use? Is there a simple way? Is there a client similar to Postman with a tRCP extension? Thank you so much
3 Replies
BeastFox
BeastFox2mo ago
@jacin can you expand on what you're trying with postman? I mean yeah it's probably not the most convenient but I just tried it with insomnia, which is very similar to postman just a bit less feature rich than postman. Worked fine with a simple test? Dunno if I can help any more than that, but can get results.
test_2: t.procedure
.input(
z.object({
test: z.string(),
})
)
.mutation(async ({ input: { test } }) => {
return { success: true, test };
}),
test_2: t.procedure
.input(
z.object({
test: z.string(),
})
)
.mutation(async ({ input: { test } }) => {
return { success: true, test };
}),
No description
jacin
jacin2mo ago
Thank you so much! With Insomnia it works! I think the way tRPC handles requests is not supported by Postman somehow. Thank you!
BeastFox
BeastFox2mo ago
You're most welcome! @jacin just incase you did want to get it working with postman, here's what I did on there as well - seems to work too. I know in some orgs there are privacy requirements so just incase it's necessary for your application :)
No description