Last active
January 1, 2016 12:19
-
-
Save arion/8143814 to your computer and use it in GitHub Desktop.
This file contains 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
params = { | |
"root_elements_without_brackets"=>[ | |
{"key"=>"value1"}, | |
{"key"=>"value2"}, | |
], | |
"root_elements[]"=>[ | |
{"key"=>"value1"}, | |
{"key"=>"value2"}, | |
], | |
"resource" => { | |
"child_elements[]"=>[ | |
{"key"=>"value1"}, | |
{"key"=>"value2"}, | |
], | |
"child_elements_without_brackets"=>[ | |
{"key"=>"value1"}, | |
{"key"=>"value2"}, | |
] | |
} | |
} | |
uri = URI.parse('http://store.dev/') | |
client = RestClient::Resource.new(uri.to_s) | |
client.post(params, {:accept => :html}) | |
# Started POST "/" for 127.0.0.1 at 2013-12-27 11:42:15 +0400 | |
# Parameters: { | |
# "root_elements_without_brackets"=>{"key"=>"value2"}, | |
# "root_elements"=>[{"key"=>"value1"}, {"key"=>"value2"}], | |
# "resource"=>{ | |
# "child_elements"=>[{"key"=>"value2"}], | |
# "child_elements_without_brackets"=>{"key"=>"value2"} | |
# } | |
# } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment