# File lib/AWS.rb, line 272
272:       def make_request(action, params, data='')
273: 
274:         @http.start do
275: 
276:           # remove any keys that have nil or empty values
277:           params.reject! { |key, value| value.nil? or value.empty?}
278: 
279:           params.merge!( {"Action" => action,
280:                           "SignatureVersion" => "2",
281:                           "SignatureMethod" => 'HmacSHA256',
282:                           "AWSAccessKeyId" => @access_key_id,
283:                           "Version" => api_version,
284:                           "Timestamp"=>Time.now.getutc.iso8601} )
285: 
286:           sig = get_aws_auth_param(params, @secret_access_key, @server)
287: 
288:           query = params.sort.collect do |param|
289:             CGI::escape(param[0]) + "=" + CGI::escape(param[1])
290:           end.join("&") + "&Signature=" + sig
291: 
292:           req = Net::HTTP::Post.new(@path)
293:           req.content_type = 'application/x-www-form-urlencoded'
294:           req['User-Agent'] = "github-amazon-ec2-ruby-gem"
295: 
296:           response = @http.request(req, query)
297: 
298:           # Make a call to see if we need to throw an error based on the response given by EC2
299:           # All error classes are defined in EC2/exceptions.rb
300:           aws_error?(response)
301:           return response
302: 
303:         end
304: 
305:       end