better curl(1) through augmentation
Switch branches/tags
Nothing to show
Clone or download
tj Merge pull request #8 from jothirams/master
-b option also needs to escaped from prepending BURL
Latest commit bceb9b8 Feb 4, 2013
Failed to load latest commit information.
bin -b option also needs to escaped from prepending BURL Feb 3, 2013
.gitignore Fixed issue in json option. Jun 25, 2012 Release 1.0.1 Jan 24, 2013
Makefile Initial commit Jun 23, 2012 docs Nov 22, 2012

Better curl(1)

burl(1) is a tiny shell script augmenting curl(1) with some helpful shortcuts.

$ POST '{"title":"better curl(1)"}' /todo/item


$ make install

Optional hostname

By default burl(1) will assume "http://localhost:3000", however you can alter this default by exporting BURL in your terminal session or .profile:

$ export BURL=
$ burl /pathname

Or like usual you can specify a full url:

$ burl

-j, --json DATA

POST data as "Content-Type: application/json":

$ burl -j {"name":"tobi"} /user

HTTP verbs

Instead of the typical -X DELETE verb usage with curl(1), you may use the verbs directly, for example:

$ burl PATCH -d '' /user/12
$ burl DELETE /users

JSON request bodies

Usually when you want to request with some JSON you do something like:

$ curl -X PATCH -d '{"name":"tobi"}' -H "Content-Type: application/json" http://localhost:3000/user/12

With burl(1) you can simply add a JSON array or object after the HTTP verb:

$ burl PATCH '{"name":"tobi"}' /user/12
$ burl POST [1,2,3] /numbers

JSON requests from files

To issue a request with the contents of ./some.json, instead of writing:

$ curl --data @some.json -H "Content-Type: application/json" http://localhost:3000/

Simply invoke:

$ POST @some.json /

Expressive header fields

With burl(1) you can define header fields without -H:

$ burl If-None-Match: etag /users
$ burl If-None-Match: etag Accept: application/json /users

Accept shorthand

Currently .json, .text and .html shorthands are available and set the Accept header field for you:

$ burl /users
$ burl /users .json
$ burl /users .text
$ burl /users .html


  • Added support for prettyjson. It needs python and json.tool module.


Try these aliases if you want to get fancy:

alias GET='burl GET'
alias HEAD='burl -I'
alias POST='burl POST'
alias PUT='burl PUT'
alias PATCH='burl PATCH'
alias DELETE='burl DELETE'
alias OPTIONS='burl OPTIONS'