http

https://github.com/emacs-pe/http.el.git

git clone 'git://github.com/emacs-pe/http.el.git'
15

http - Yet another HTTP client

Author: Mario Rodas mailto:marsam@users.noreply.github.com
Version: 0.0.1

Travis build status

http.el provides an easy way to interact with the HTTP protocol.

Usage

Create a file with the following contents, and set http-mode as major mode.

# -*- http -*-

POST https://httpbin.org/post?val=key
User-Agent: Emacs24
Content-Type: application/json

{
  "foo": "bar"
}

Move the cursor somewhere within the description of the http request and execute M-x http-process or press C-c C-c, if everything is went well should show an buffer when the response of the http request:

http.el screenshot

More examples are included in file misc/example.txt

Customisation

If you want to use a custom mode for rendering a response with content-type equal to “application/json”, say json-mode:

    (add-to-list 'http-content-type-mode-alist
                 '("application/json" . json-mode))

If you want to use a custom prettify function for a response with content equal to “application/json”, say json-reformat:

    (require 'json-reformat)
    (defun my/pretty-json-buffer ()
      (json-reformat-region (point-min) (point-max)))
    (add-to-list 'http-pretty-callback-alist
                 '("application/json" . my/pretty-json-buffer))

Related projects

TODO

— Converted from http.el by el2markdown.