Method: PMP::Token#connection_options
- Defined in:
- lib/pmp/token.rb
#connection_options(opts = {}) ⇒ Object
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/pmp/token.rb', line 40 def (opts={}) headers = opts.delete(:headers) || {} = { headers: { 'User-Agent' => opts[:user_agent], 'Accept' => 'application/json', 'Content-Type' => 'application/x-www-form-urlencoded' }, ssl: {:verify => false}, url: opts[:endpoint] }.merge(opts) [:headers] = [:headers].merge(headers) # clean out any that don't belong .select{|k,v| PMP::Connection::ALLOWED_CONNECTION_OPTIONS.include?(k.to_sym)} end |