Created
November 1, 2012 00:20
-
-
Save rpkraemer/3990820 to your computer and use it in GitHub Desktop.
Restc use
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
| //create | |
| request = Restc.at("http://afternoon-fortress-4074.herokuapp.com/entries"); | |
| response = request.mediaType(MediaType.FORM_ENCODED) | |
| .data("entry[description] => created from java", | |
| "entry[value] => 100.999") | |
| .post(); | |
| //update | |
| String jsonPut = "{\"description\": \"update from Java 51(json)\", \"value\": 123, \"entry_type\": \"J\"}"; | |
| response = Restc.at("http://afternoon-fortress-4074.herokuapp.com/entries/51") | |
| .mediaType(MediaType.JSON) | |
| .data(jsonPut) | |
| .put(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment