class ApontadorOauth2::Request

Public Class Methods

json(data) click to toggle source
# File lib/apontador_oauth2/request.rb, line 15
def self.json(data)
 JSON.parse(data)
end
send(options) click to toggle source
# File lib/apontador_oauth2/request.rb, line 3
def self.send(options)
  conn = Faraday.new(:url => options[:url])
  res = conn.get do |req|
    req.url(options[:path])
    req.headers['Content-Type']  =  "application/json"
    req.headers['Authorization'] =  "Bearer #{options[:token]}"
    req.headers['Accept']        =  "application/json"
    req.body = {:user => options[:user]}.to_json if options[:user]
  end
 res
end