I have been working on a Wordpress plugin and I come from a background where I usually write my own REST endpoints (Rails etc). My question is, how do I from a WP plugin create rest url endpoints?
E.g.:
/myplugin/save-tutorial (POST takes JSON and returns JSON) /myplugin/get-tutorial?id= (GET returns JSON)
How do I create such REST endpoints? I have looked at admin-ajax.php and that seems about right, but still pretty messy. It seems like a simple problem though. I want to process the responses in my-plugin.php.
Thanks in advance!