lib/aws/ses/base.rb
# Make the connection to AWS passing in our request.  
# allow us to have a one line call in each method which will do all of the work
# in making the actual request to AWS.
Make the connection to AWS passing in our request.
allow us to have a one line call in each method which will do all of the work
in making the actual request to AWS.
Make the connection to AWS passing in our request . allow us to have a one line call in each method which will do all of the work in making the actual request to AWS .
def request(action, params = {})
        params = params.reject { |key, value| value.nil? or value.empty?}
        timestamp = Time.now.getutc
        params.merge!( {"Action" => action,
                        "SignatureVersion" => signature_version.to_s,
                        "SignatureMethod" => 'HmacSHA256',
                        "AWSAccessKeyId" => @access_key_id,
                        "Version" => API_VERSION,
                        "Timestamp" => timestamp.iso8601 } )
        query = params.sort.collect do |param|
          CGI::escape(param[0]) + "=" + CGI::escape(param[1])
        end.join("&")
        req = {}
        req['X-Amzn-Authorization'] = get_aws_auth_param(timestamp.httpdate, @secret_access_key, action, signature_version)
        req['Date'] = timestamp.httpdate
        req['User-Agent'] = @user_agent
        response = connection.post(@path, query, req)
        response_class = AWS::SES.const_get( "#{action}Response" )
        result = response_class.new(action, response)
        if result.error?
          raise ResponseError.new(result)
        end
        result
      end
def request ( action , params = { } ) params = params . reject { | key , value | value . nil? or value . empty? } timestamp = Time . now . getutc params . merge! ( { "Action" => action , "SignatureVersion" => signature_version . to_s , "SignatureMethod" => 'HmacSHA256' , "AWSAccessKeyId" => @access_key_id , "Version" => API_VERSION , "Timestamp" => timestamp . iso8601 } ) query = params . sort . collect do | param | CGI :: escape ( param [ 0 ] ) + "=" + CGI :: escape ( param [ 1 ] ) end . join ( "&" ) req = { } req [ 'X-Amzn-Authorization' ] = get_aws_auth_param ( timestamp . httpdate , @secret_access_key , action , signature_version ) req [ 'Date' ] = timestamp . httpdate req [ 'User-Agent' ] = @user_agent response = connection . post ( @path , query , req ) response_class = AWS :: SES . const_get ( "#{action}Response" ) result = response_class . new ( action , response ) if result . error? raise ResponseError . new ( result ) end result end
Make the connection to AWS passing in our request.
Make the connection to AWS passing in our request .
# Use a copy so that we don't modify the caller's Hash, remove any keys that have nil or empty values
action
<not_specific>
params
<not_specific>