struct Packlink::Client

Defined in:

packlink/client.cr

Constant Summary

API_VERSION = "v1"
METHODS = ["GET", "POST"] of ::String

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(api_key : String? = Config.api_key) #

[View source]
def self.new(require_key : Bool) #

[View source]

Class Method Detail

def self.instance #

[View source]
def self.instance_without_api_key #

[View source]
def self.with_api_key(api_key : String?) #

[View source]
def self.with_api_key(api_key : String?, &) #

[View source]

Instance Method Detail

def api_key : String? #

[View source]
def api_path(path : String, id : String? = nil) #

[View source]
def endpoint #

[View source]
def get(path : String, query : Hash | NamedTuple = A::HS2.new, headers : Hash | NamedTuple = A::HS2.new) #

[View source]
def perform_http_call(method : String, path : String, body : Hash | NamedTuple = A::HS2.new, query : Hash | NamedTuple = A::HS2.new, headers : Hash | NamedTuple = A::HS2.new) #

[View source]
def post(path : String, body : Hash | NamedTuple, query : Hash | NamedTuple = A::HS2.new, headers : Hash | NamedTuple = A::HS2.new) #

[View source]