ChrisLi
ChrisLi4mo ago

Http actions VS Actions

Hey guys, I have a question, when I went through the docs, I'm not sure what is the main diff between http actions and actions. Wonder when to use which. 🧐
3 Replies
jamwt
jamwt4mo ago
Actions are called via convex's standard rpc mechanism. useAction inside a react app for example. http actions are called via an HTTP request using whatever convention you want. maybe a REST interface? so standard actions are a typechecked function interface, just like mutations and queries, while HTTP actions are just an HTTP request that you need to design and decode the semantics of
ChrisLi
ChrisLiOP4mo ago
That makes more sense to me! Thanks!
sshader
sshader4mo ago
Yeah I like to say that Convex functions (queries, mutations, actions) "speak in Convex values" -- their args + return values must be valid Convex values. But HTTP actions "speak in HTTP Request + Response"

Did you find this page helpful?