HTTP request lib for Emacs built on curl with flexible callback dispatch
Emacs Lisp
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


A HTTP request lib for Emacs with flexible callback dispatch.

grapnel is an HTTP request library that uses a curl subprocess and offers flexible callback dispatch. Not only can you pass in an alist of request outcomes to callback functions (see below) but you can also override the dispatch function itself if the default one doesn’t suit your needs. Further, grapnel will build the query string, request data (i.e., POST body), and headers from alists that are passed in.

See the inline docs for more information.


Via Marmalade/Melpa

(require 'package)
(add-to-list 'package-archives
             '("marmalade" . "") t)
(add-to-list 'package-archives
             '("melpa" . "") t)

Then you can install it:

M-x package-refresh-contents
M-x package-install RET grapnel RET

Manually (via git)

Download the source or clone the repo and add the following to ~/.emacs.d/init.el:

(add-to-list 'load-path "path/to/grapnel")
(require 'grapnel)

Usage Example

   `((401 . (lambda (response headers)
              (error "Unauthorized!")))
     (success . ,success-callback)
     (failure . (lambda (response headers)
                  (error "Failed with: %s for %s"
                         (cadr (assoc "response-code" headers))
     (error . (lambda (response)
                (error "Error: %s" response))))
   '((some-param . "some-value")))


Copyright © 2013 David Leatherman.

Files are licensed under the same license as Emacs unless otherwise specified. See the file LICENSE for details.

You should have received a copy of the GNU General Public License along with this program. If not, see