Last active
September 15, 2016 20:47
-
-
Save caot/75f04f482bdf05dbb205 to your computer and use it in GitHub Desktop.
jsawk example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| HOST=node:port | |
| auth=`curl -X POST -H "Content-Type: application/json" -d '{"username":"xxxx","password":"yyyy"}' http://hostname/ws/auth-token/ | jsawk 'return this.payload.token'` | |
| curl -sw '\n%{http_code}' -H "Authorization: JWT $auth" -X GET http://hostname/ws/users/{pk}/ | |
| curl -sw '\n%{http_code}' -X POST -H "Authorization: JWT $auth" -H "Content-Type: application/json" -d '{"date":"2016-05-05 05:52:00","id":1}' http://$HOST/action/ | |
| here is more example: | |
| http://blog.xebia.com/2012/06/27/json-shell-scripting-with-jsawk/ | |
| http://www.programering.com/q/MjN1EzMwATA.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment