Class: Octogate::TransferRequest::POST

Inherits:
Base
  • Object
show all
Defined in:
lib/octogate/transfer_request.rb

Instance Attribute Summary

Attributes inherited from Base

#conn

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Octogate::TransferRequest::Base

Instance Method Details

#do_request(**options) ⇒ Object



28
29
30
31
32
33
34
35
36
37
# File 'lib/octogate/transfer_request.rb', line 28

def do_request(**options)
  if options[:parameter_type] == :json && options[:params]
    conn.post options[:url] do |req|
      req.headers['Content-Type'] = 'application/json'
      req.body = Oj.dump(options[:params])
    end
  else
    conn.post options[:url], options[:params]
  end
end