class Amazonite::Core::Client

Overview

Base HTTP client every generated per-service Client subclasses - signs requests with SigV4, dispatches them over one of the three wire protocols (#post for awsJson, #rest_request for rest-json, #query_request for awsQuery), and raises the service's exception type on a non-2xx response.

Direct Known Subclasses

Defined in:

core/client.cr

Constant Summary

Log = ::Log.for(self)

Constructors

Instance Method Summary

Constructor Detail

def self.new(target_prefix : String, endpoint_prefix : String, json_version : String, exception_factory : ResponseExceptionFactory, config : Amazonite::Core::Config = Config.new) #

[View source]

Instance Method Detail

def post(command, url, body : String) #

awsJson protocol entry point: routes the operation via the X-Amz-Target header (target_prefix.command) and sends body as the entire JSON request body.


[View source]
def query_request(command : String, body : String) #

awsQuery protocol entry point: POST / with a form-urlencoded body (Action/Version plus the flattened operation params the caller has already built) and an XML response/error body, unlike #post's JSON.


[View source]
def rest_request(command : String, method : String, path : String, headers : HTTP::Headers, body : String | Nil) #

rest-json protocol entry point: unlike #post, the caller has already routed operation members into the method/path/headers/body themselves (rest-json has no fixed X-Amz-Target routing - the method and URI path are the routing), so this just signs and dispatches what it's given.


[View source]