Introduction
The <span>restclient</span>
in Emacs has been archived and is no longer maintained, so we need to look for other packages to replace it.
After some searching, I found that federicotdn/verb: HTTP client for Emacs[1] is quite good and also supports <span>org babel</span>
.
Installation
(use-package verb
:init (cl-pushnew '(verb . t) load-language-list)
:config (define-key org-mode-map (kbd "C-c C-r") verb-command-map))
Usage
<span>Verb</span>
supports two methods. The first method is to add the <span>Verb</span>
tag to a headline in Org Mode.
* Http request :verb:
get https://httpbin.org/get
Accept: application/json
Note that when using this method, there should be no indentation. I spent a long time figuring this out; otherwise, using <span>x-www-form-urlencoded</span>
would cause issues.
The second method is to use <span>org babel</span>
.
#+begin_src verb
get https://httpbin.org/get
Accept: application/json
#+end_src
After execution, the response is as follows:
HTTP/1.1 200 OK
Date: Mon, 24 Mar 2025 12:52:51 GMT
Content-Type: application/json
Content-Length: 293
Connection: keep-alive
Server: gunicorn/19.9.0
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
{
"args": {},
"headers": {
"Accept": "application/json",
"Accept-Encoding": "gzip",
"Host": "httpbin.org",
"Mime-Version": "1.0",
"X-Amzn-Trace-Id": "Root=1-67e155a1-19b45d090d39dd3a02fe2b2c"
},
"origin": "...",
"url": "https://httpbin.org/get"
}
Export
<span>Verb</span>
also has a very attractive feature, which is support for exporting to <span>curl</span>
, as shown below:
#+begin_src verb :op export curl
#+end_src
Conclusion
<span>Verb</span>
is quite similar to <span>restclient</span>
, with no significant switching costs, and it also supports exporting, making it a good choice.
References[1]
federicotdn/verb: HTTP client for Emacs: https://github.com/federicotdn/verb?tab=readme-ov-file
Previous Recommendations
Update Docker Container Images
Create x86 Docker Images on M Series Chip Macs
Export Docker Images for Use on Other Computers