Skip to content

Instantly share code, notes, and snippets.

@booyaa
Last active December 15, 2015 12:48
Show Gist options
  • Select an option

  • Save booyaa/5262461 to your computer and use it in GitHub Desktop.

Select an option

Save booyaa/5262461 to your computer and use it in GitHub Desktop.
curl magick

####how to ignore a duff certificate

curl -k https://cheaphosting.com

####how to HTTP POST json data and how to set headers

curl -H 'Content-Type: application/json' -X POST -d @stuff.json http://jsonapiserver.com

where @stuff.json is

{
  "Hello": "World",
  "Killroy": "Wuz",
  "Here": "lolz"    
}

####how to store and use cookies

source: http://www.lornajane.net/posts/2009/cookies-and-curl

1st call (creates the cookie jar)

curl -c cookjar.txt http://cookiemonster.org

2nd call (uses the cookie jar)

curl -b cookjar.txt http://cookiemonster.org

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment