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

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s