Class: Appboy::HTTP
- Inherits:
-
Object
- Object
- Appboy::HTTP
- Defined in:
- lib/appboy/http.rb
Instance Method Summary collapse
Instance Method Details
#connection ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/appboy/http.rb', line 16 def connection @connection ||= Faraday.new(url: api_host) do |connection| connection.request :json connection.response :logger if ENV['APPBOY_DEBUG'] connection.adapter Faraday.default_adapter end end |
#get(path, query) ⇒ Object
12 13 14 |
# File 'lib/appboy/http.rb', line 12 def get(path, query) connection.get path, query end |
#post(path, payload) ⇒ Object
6 7 8 9 10 |
# File 'lib/appboy/http.rb', line 6 def post(path, payload) connection.post path do |request| request.body = payload end end |