lib/zeppelin.rb in zeppelin-0.8.1 vs lib/zeppelin.rb in zeppelin-0.8.2
- old
+ new
@@ -1,6 +1,7 @@
require 'faraday'
+require 'faraday_middleware'
require 'time'
# A very tiny Urban Airship Push Notification API client.
#
# Provides thin wrappers around API calls to the most common API tasks. For more
@@ -300,16 +301,14 @@
end
private
def initialize_connection
- Faraday::Request::JSON.adapter = MultiJson
-
conn = Faraday::Connection.new(BASE_URI, @options) do |builder|
builder.request :json
- builder.use Zeppelin::Middleware::JsonParser
- builder.use Zeppelin::Middleware::ResponseRaiseError
+ builder.response :json, :content_type => /\bjson$/
+ builder.response :zeppelin_raise_error
builder.adapter :net_http
end
conn.basic_auth(@application_key, @application_master_secret)