Begin consolidation of request building in reference. Further changes coming to simplify batch + media handling

This commit is contained in:
Steven Bazyl committed 2012-09-05 14:56:52 -07:00
1 parent 8e26241e1c
commit 18d3cccd6a
8 files changed
+155 -312

No files matched your search

@@ -224,13 +224,6 @@ module Google
# @return [Array] The generated HTTP request.
def generate_request(parameters={}, body='', headers=[], options={})
options[:connection] ||= Faraday.default_connection
if body.respond_to?(:string)
body = body.string
elsif body.respond_to?(:to_str)
body = body.to_str
else
raise TypeError, "Expected String or StringIO, got #{body.class}."
end
if !headers.kind_of?(Array) && !headers.kind_of?(Hash)
raise TypeError, "Expected Hash or Array, got #{headers.class}."
end