class BucketClient::AWSHttpClient
Public Class Methods
new(signer, region, http)
click to toggle source
@param [Client::AWS4RequestSigner] signer aws4 signer @param [String] region region of the service @param [KirinHttp::Client] http Http client to send http Message
# File lib/bucket_client/aws/aws_http_client.rb, line 9 def initialize(signer, region, http) @signer = signer @region = region @http = http end
Public Instance Methods
query(method, endpoint, content = nil, type = "text/plain", accept = nil)
click to toggle source
@param [Symbol] method @param [String] endpoint @param [Object] content @param [String] type @return [KirinHttp::Response]
# File lib/bucket_client/aws/aws_http_client.rb, line 20 def query(method, endpoint, content = nil, type = "text/plain", accept = nil) accept = type if accept.nil? header = { "Content-Type": type, "Accept": accept } message = KirinHttp::Message.new(endpoint, method, content, header) message = @signer.sign message, "s3", @region @http.send message end