Skip to content

Instantly share code, notes, and snippets.

@toolbear
Last active January 20, 2017 20:31
Embed
What would you like to do?
RESTy: CLI rest helpers
function GET() {
curl -sSL -i -XGET 'http://localhost:8080'$1 |json
}
function PUT() {
curl -sSL -i -XPUT --data-binary @- -H'Content-type: application/json' 'http://localhost:8080'$1 |json
}
function POST() {
curl -sSL -i -XPOST --data-binary @- -H'Content-type: application/json' 'http://localhost:8080'$1 |json
}
function DELETE() {
curl -sSL -i -XDELETE 'http://localhost:8080'$1 |json
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment