Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add expressive http verb usage

  • Loading branch information...
commit 6b5bbf6e11c278c7f68ad8228b0b4aa0fc284d78 1 parent de352d4
@tj authored
Showing with 15 additions and 0 deletions.
  1. +10 −0 Readme.md
  2. +5 −0 bin/burl
View
10 Readme.md
@@ -25,6 +25,16 @@ $ burl /pathname
$ 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 'email=tobi@learnboost.com' /user/12
+$ burl DELETE /users
+```
+
## Expressive header fields
With `burl(1)` you can define header fields without `-H`:
View
5 bin/burl
@@ -48,6 +48,11 @@ while test $# -ne 0; do
json=$1; shift
args="$args -H 'Content-Type: application/json' -d '$json'"
;;
+ GET|POST|PUT|HEAD|DELETE|OPTIONS|PATCH|TRACE|COPY|LOCK|\
+ MKCOL|MOVE|PROPFIND|PROPPATCH|UNLOCK|REPORT|MKACTIVITY|\
+ CHECKOUT|MERGE|NOTIFY|SUBSCRIBE|UNSUBSCRIBE)
+ args="$args -X $arg"
+ ;;
*:)
val=$1; shift
args="$args -H \"$arg $val\""
Please sign in to comment.
Something went wrong with that request. Please try again.