curl https://example.com #GET request
curl -X POST https://example.com -d '{"key":"value"}' #POST request
curl -X PATCH https://example.com -d '{"key":"value"}' #PATCH request
-d key="value" #json format
-d @file.json #file as input
-k #for insecure requests/self signed certs
-o <file> #store output in a file
-v #verbose
-vv #extra verbose
-s #silent
-u user:pass #authentication
(use '\' to escape special characters in user or password)
-H #header (example, -H 'Content-type: Application/json')
curl https://example.com | json_pp #pretty print json type response from curl.
For this to work the response should be in json format.
Comments