Last active
September 29, 2022 00:41
-
-
Save jhyland87/6780d87dd1fc89f3ae38cf450a08ed99 to your computer and use it in GitHub Desktop.
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
function curlcmd() { | |
method=${1:-GET} | |
method=$(echo $method | tr '[a-z]' '[A-Z]') | |
/usr/bin/curl -X ${method} -i --header 'Accept: application/json' ${@:2} && echo | |
} | |
alias cjpost="curlcmd post" | |
alias cjget="curlcmd get" | |
alias cjput="curlcmd put" | |
alias cjdel="curlcmd delete" | |
: <<'example_result' | |
$ cjget http://petstore.swagger.io/v2/pet/1 | |
HTTP/1.1 200 OK | |
Date: Mon, 19 Sep 2016 16:12:51 GMT | |
Access-Control-Allow-Origin: * | |
Access-Control-Allow-Methods: GET, POST, DELETE, PUT | |
Access-Control-Allow-Headers: Content-Type, api_key, Authorization | |
Content-Type: application/json | |
Connection: close | |
Server: Jetty(9.2.9.v20150224) | |
{"id":1,"category":{"id":1,"name":"string"},"name":"foo","photoUrls":["string"],"tags":[{"id":0,"name":"string"}],"status":"bar"} | |
example_result |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment