Skip to content

Instantly share code, notes, and snippets.

@sdogruyol
Last active June 20, 2016 12:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sdogruyol/a8494ee4a904ee4f1f5e8f0b6c14bcb1 to your computer and use it in GitHub Desktop.
Save sdogruyol/a8494ee4a904ee4f1f5e8f0b6c14bcb1 to your computer and use it in GitHub Desktop.
require "kemal"
post "/json_params" do |env|
json = env.params.json["likes"].as Array
# You can learn the type like this
puts json.first.class
first = json.first.as Hash(String, JSON::Type)
puts first["id"]
end
Kemal.run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment