lib/vkontakte_api/api.rb in vkontakte_api-1.0.1 vs lib/vkontakte_api/api.rb in vkontakte_api-1.0.2
- old
+ new
@@ -12,11 +12,11 @@
# @param [Hash] args Method arguments.
# @param [String] token The access token.
# @return [Hashie::Mash] Mashed server response.
def call(method_name, args = {}, token = nil)
flat_arguments = Utils.flatten_arguments(args)
- connection(:url => URL_PREFIX, :token => token).get(method_name, flat_arguments).body
+ connection(:url => URL_PREFIX, :token => token).send(VkontakteApi.http_verb, method_name, flat_arguments).body
end
# Faraday connection.
# @param [Hash] options Connection options.
# @option options [String] :url Connection URL (either full or just prefix).
@@ -27,9 +27,10 @@
token = options.delete(:token)
Faraday.new(url, VkontakteApi.faraday_options) do |builder|
builder.request :oauth2, token unless token.nil?
builder.request :multipart
+ builder.request :url_encoded
builder.response :vk_logger
builder.response :mashify
builder.response :oj, :preserve_raw => true
builder.adapter VkontakteApi.adapter
end