Created
October 26, 2012 01:59
-
-
Save joncode/3956523 to your computer and use it in GitHub Desktop.
CURL commands
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| test the drinkboard menu route : | |
| sending a POST command with an id only | |
| curl http://drinkboard.herokuapp.com/app/menu.json -d 40 | |
| send a POST command with the remember token in the params | |
| curl http://localhost:3000/app/providers.json -d "token=vaRlsrT-JjQRkbAhtN27-w" | |
| example of multiple data route | |
| curl http://example.com/users -d"first_name=Bruce&last_name=Wayne" | |
| from rails console | |
| system ("/usr/bin/curl http://0.0.0.0.:3000/app/providers.json -d'token=vaRlsrT-JjQRkbAhtN27-w'") | |
| to see if response exists | |
| to get response in data from json | |
| s = String.new(%x{curl http://0.0.0.0.:3000/app/providers.json -d'token=vaRlsrT-JjQRkbAhtN27-w'}) | |
| response = JSON.parse s | |
| VIOLA! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment