class

Amazonite::Core::Client

Inherits Reference < Object

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

Constants

Log = ::Log.for(self)

Constructors

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

Instance methods

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.

Source
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.

Source
rest_request(command : String, method : String, path : String, headers : HTTP::Headers, body : String | Nil, content_type : String = "application/json")

rest protocol entry point: unlike #post, the caller has already routed operation members into the method/path/headers/body themselves (a rest protocol 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. rest-json and rest-xml differ only in how that body was serialized, which is what content_type announces.

Source