class TandaCLI::API::Request

Defined in:

tanda_cli/api/request.cr

Constant Summary

CONNECT_TIMEOUT = 10.seconds
FETCHING_MESSAGE = "Fetching…"
GET = "GET"
INTERNAL_SERVER_ERROR_STRING = "Internal Server Error"
POST = "POST"
PUT = "PUT"
READ_TIMEOUT = 30.seconds
SENDING_MESSAGE = "Sending…"
WRITE_TIMEOUT = 10.seconds

Constructors

Instance Method Summary

Constructor Detail

def self.new(base_uri : String, token : String, current_user : Current::User | Nil = nil) #

[View source]

Instance Method Detail

def get(type : T.class, endpoint : String, query : Query | Nil = nil) : Result(T) forall T #

[View source]
def post(type : T.class, endpoint : String, body : Body | JSON::Serializable) : Result(T) forall T #

[View source]
def put(type : T.class, endpoint : String, body : JSON::Serializable) : Result(T) forall T #

[View source]