class

RestClient

Inherits HTTP::Client < Reference < Object

Class methods

getCharacter(id)
Source
getEpisode(id)
Source
getLocation(id)
Source

Instance methods

get(url)

Executes a GET request. The response will have its body as a String, accessed via HTTP::Client::Response#body.

require "http/client"

client = HTTP::Client.new("www.example.com")
response = client.get("/", headers: HTTP::Headers{"User-Agent" => "AwesomeApp"}, body: "Hello!")
response.body #=> "..."
Source