emaksovalec's Blog

emaksovalec's Avatar Image
Emacs fan from Slovenia. Interested in #linux #emacs #lisp #scheme and so on :)
← All posts

I’m happy to discover another neat #webdev #emacs #elisp hack. I want to use command line for some API testing with curl. API returns two headers that must then be included in subsequent requests. One of the headers is only valid for one subsequent request only.

Doing this manually is a pain in the ass because you have to constantly copy&paste headers and you need to do it fast.

But #eshell allows me to register a custom elisp handler for process output so I can easily parse out header values, store them into variables and then plug them back in command line as an env variable. And all of that in just 8 lines of code!

To like or reply, open original post on Emacs.ch