lib/dirigible/request.rb in dirigible-1.0.3 vs lib/dirigible/request.rb in dirigible-1.0.4
- old
+ new
@@ -24,10 +24,16 @@
'Accept' => 'application/vnd.urbanairship+json; version=3;',
})
response = connection.send(method) do |request|
request.url("#{endpoint}#{path}/")
- request.body = options.to_json
+
+ if [:post, :put].member?(method)
+ request.body = options.to_json
+ else
+ request.params.merge!(options)
+ end
+
request.headers.merge!(headers)
end
Utils.handle_api_error(response) unless (200..399).include?(response.status)