Use Emacs like Postman for API testing

Published on Sep 8, 2021, by Junji Zhi

Doom Emacs has the restclient mode support for org-mode code block. To turn it on, uncomment the rest under :lang in init.el.

Then we can do something like in an *.org file:

#+begin_src restclient

After pressing C-c C-c, we see the results as in plain text:

  "userId": 1,
  "id": 1,
  "title": "delectus aut autem",
  "completed": false
// GET
// HTTP/1.1 200 OK
// Date: Tue, 08 Sep 2021 18:18:38 GMT
// Content-Type: application/json; charset=utf-8
// Transfer-Encoding: chunked
// ...