class Halite::Client

Overview

Clients make requests and receive responses

Support all Chainable methods.

Simple setup

client = Halite::Client.new(headers: {
  "private-token" => "bdf39d82661358f80b31b67e6f89fee4"
})

client.auth(private_token: "bdf39d82661358f80b31b67e6f89fee4").
      .get("http://httpbin.org/get", params: {
        name: "icyleaf"
      })

Setup with block

client = Halite::Client.new do
  basic_auth "name", "foo"
  headers content_type: "application/jsong"
  read_timeout 3.minutes
  logging true
end

Included Modules

Defined in:

lib/halite/src/halite/client.cr
sabo/ext/client.cr

Instance Method Summary

Instance Method Detail

def perform(request : Halite::Request, options : Halite::Options) : Halite::Response #

Perform a single (no follow) HTTP request


[View source]