Some curl tips

  • Show headers with -I and change request type with -X. e.g.
curl -I -X DELETE  http://localhost/blah
  • To add a header in the outgoing request, use -H:
curl --header "X-MyHeader: 123" www.google.com
  • Follow redirects with -l
  • Disable security check with -k
  • Send content with -d:
curl -X POST --header "Content-Type: application/json" -d '{"test": true}' http://localhost/blah

Leave a Reply