Last active
June 20, 2016 12:08
-
-
Save sdogruyol/a8494ee4a904ee4f1f5e8f0b6c14bcb1 to your computer and use it in GitHub Desktop.
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
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