lib/goauth2/client.rb in goauth2-0.0.9 vs lib/goauth2/client.rb in goauth2-0.0.10
- old
+ new
@@ -83,23 +83,20 @@
res = _get(url, params, headers)
end
def _get(url, params={}, headers = {})
oauth_response = access_token.get(url, :params => params, :headers => headers)
- hash_response = Goauth2::HashResponse.new(JSON.parse(oauth_response.body))
- {:oauth_response => oauth_response, :hash_response => hash_response}
- rescue
- res
+ Goauth2::HashResponse.new(JSON.parse(oauth_response.body)) rescue oauth_response
end
def _post(url, params={}, headers={})
oauth_response = access_token.post(url, params, headers)
- JSON.parse(oauth_response) rescue oauth_response
+ Goauth2::HashResponse.new(JSON.parse(oauth_response.body)) rescue oauth_response
end
def _delete(url)
oauth_response = access_token.delete(url)
- JSON.parse(oauth_response) rescue oauth_response
+ Goauth2::HashResponse.new(JSON.parse(oauth_response.body)) rescue oauth_response
end
end
end