cURL

cURL

Client URL: A command line library/tool to send data from terminal.

#Get only body (default method is GET)
curl https://api.yomomma.info

#Get only header
curl -I https://api.yomomma.info

#Get both header and body
curl -i https://api.yomomma.info

#Verbose and more verbose
curl -v https://api.yomomma.info
curl -vv https://api.yomomma.info

#Output to file
curl -o output.txt https://api.yomomma.info
curl -o https://api.yomomma.info -o output.txt

#GET
curl -X GET https://api.yomomma.info

#POST
curl -d '{"id":1,"name":"foobar"}' http://localhost:5000/user
curl -X POST -d '{"id":1,"name":"foobar"}' http://localhost:5000/user

#Input from file
curl -d @output.txt https://api.yomomma.info

#Any other method
curl -X PUT -d ...
curl -X DELETE ...

#Custom Header
curl -X POST -H "Content-Type: application/json" http://example.com

References