Skip to content

Instantly share code, notes, and snippets.

@manuelmorales
Last active October 1, 2015 12:48
Show Gist options
  • Save manuelmorales/1995276 to your computer and use it in GitHub Desktop.
Save manuelmorales/1995276 to your computer and use it in GitHub Desktop.
Make a post with curl using cookies
export SERVER=dev.workshare.com
export [email protected]
read PASS
# Logging in
curl -X POST https://$SERVER/api/v1.2/user_sessions.json -F "user_session[email]=$USER" -F "user_session[password]=$PASS" -b tmp/dev.jar -c tmp/dev.jar
# Validating user with ID 99999
curl -X PUT https://$SERVER/users/99999.json -b tmp/dev.jar -c tmp/dev.jar -F 'record[is_unknown_user]=false'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment