module Kagi::Request

Overview

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

Defined in:

kagi/request.cr

Constant Summary

Log = Kagi::Log.for(self)

Class Method Summary

Class Method Detail

def self.api_version : String #

Gets the current API version, defaulting to "v0"


[View source]
def self.api_version=(version : String) #

Set the API version to be used for queries


[View source]
def self.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.


[View source]
def self.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.


[View source]