Module: MaxemailApiShared

Included in:
MaxemailApiSubscriptions, MaxemailApiTriggered
Defined in:
lib/maxemail_api/shared.rb

Class Method Summary collapse

Class Method Details

.send_request(params:, method:) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/maxemail_api/shared.rb', line 3

def send_request(params:, method:)
  puts 'MaxemailApiResponse params and Method:'
  puts "form_params: #{params}"
  puts "method: #{method}"
  puts 'END MaxemailApiResponse params and Method:'
  response = HTTP.headers(authentication_header)
                 .post("#{ENV['MAXEMAIL_API_URL']}#{method}",
                       form: params)
  puts 'MaxemailApiResponse:'
  puts response
  puts 'END MaxemailApiResponse :'
  response
end