Using Curl In Bash For Endpoint Rest Testing

Description

Sometimes I am shelled into an environment or server that I cannot revers proxy through and I can’t run programs like Postman or Advanced Rest Client, which are great programs. I use the following aliases inside my .bashrc files in every server I set up because of how useful they are. This way we can test if a server has access to a particular endpoint or we can see the response of an endpoint called from the server.




[bash]
# curl aliases
alias get=’curl -X GET’
alias geti=’curl -i -X GET’
alias post=’curl -X POST’
alias posti=’curl -i -X POST’
alias put=’curl -X PUT’
alias puti=’curl -i -X PUT’
alias delete=’curl -X DELETE’
alias deletei=’curl -i -X DELETE’
[/bash]

Leave a Reply

Your email address will not be published. Required fields are marked *