Skip to content

Instantly share code, notes, and snippets.

@arion
Last active January 1, 2016 12:19
Show Gist options
  • Save arion/8143814 to your computer and use it in GitHub Desktop.
Save arion/8143814 to your computer and use it in GitHub Desktop.
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