module

Kagi::Request

HTTP::Client wrapper methods for interacting with the Kagi API

Constants

Log = Kagi::Log.for(self)

Class methods

api_version

Gets the current API version, defaulting to "v0"

Source
api_version=(version : String)

Set the API version to be used for queries

Source
get(path : String, params : String) : HTTP::Client::Response

Perform a get request to a given path with params, attaching the API key set via KAGI_API_KEY. Raises an exception if the request was unsuccessful.

Source
post(path : String, body : String, headers : HTTP::Headers | Nil = nil) : HTTP::Client::Response

Perform a post request to a given path, body, and optional headers, attaching the API key set via KAGI_API_KEY. Raises an exception if the request was unsuccessful.

Source