snipplets.dev/code/Crystal/http_client.cr
2023-09-26 22:05:13 +03:00

12 lines
272 B
Crystal

require "json"
require "http/client"
minecraft_url = "https://launchermeta.mojang.com/mc/game/version_manifest_v2.json"
response = HTTP::Client.get minecraft_url
version_manifest = JSON.parse(response.body)
version = version_manifest["latest"]["release"]
puts version