http/client
This commit is contained in:
parent
4f72bea6f4
commit
73da1dd6cb
@ -7,6 +7,7 @@
|
||||
- [Colorize](Colorize.cr) - Цветной вывод в консоль
|
||||
- [JSON](json.cr) - Пример работы с JSON
|
||||
- [Fiber](schedule.cr) - Пример распаралеливания кода и расписания
|
||||
- [http/client](http_client.cr) - Пример HTTP клиента
|
||||
|
||||
## Stuff
|
||||
- [`irc_bot.cr`](irc_bot.cr) - Реализация клиента (бота) для IRC
|
||||
|
11
~/Crystal/http_client.cr
Normal file
11
~/Crystal/http_client.cr
Normal file
@ -0,0 +1,11 @@
|
||||
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
|
Loading…
Reference in New Issue
Block a user