lib/google_apps/transport.rb in google_apps-0.3.0 vs lib/google_apps/transport.rb in google_apps-0.3.1
- old
+ new
@@ -13,11 +13,11 @@
def initialize(domain, targets = {})
@auth = targets[:auth] || "https://www.google.com/accounts/ClientLogin"
@user = targets[:user] || "https://apps-apis.google.com/a/feeds/#{domain}/user/2.0"
@pubkey = targets[:pubkey] || "https://apps-apis.google.com/a/feeds/compliance/audit/publickey/#{domain}"
@migration = targets[:migration] || "https://apps-apis.google.com/a/feeds/migration/2.0/#{domain}"
- @group = targets[:group]
+ @group = targets[:group] || "https://apps-apis.google.com/a/feeds/group/2.0/#{domain}"
@nickname = targets[:nickname]
@export = targets[:export] || "https://apps-apis.google.com/a/feeds/compliance/audit/mail/export/#{domain}"
@token = nil
@response = nil
@request = nil
@@ -56,11 +56,11 @@
# request_export returns the HTTP response received
# from Google.
def request_export(username, document)
uri = URI(@export + "/#{username}")
@request = Net::HTTP::Post.new uri.path
- @request.body = document
+ @request.body = document.to_s
set_headers :user
@response = request(uri)
end
@@ -117,11 +117,11 @@
#
# add returns the HTTP response received from Google.
def add(endpoint, document)
uri = URI(instance_variable_get("@#{endpoint.to_s}"))
@request = Net::HTTP::Post.new(uri.path)
- @request.body = document
+ @request.body = document.to_s
set_headers :user
@response = request(uri)
end
@@ -164,10 +164,10 @@
#
# migrate returns the HTTP response received from Google.
def migrate(username, properties, message)
uri = URI(@migration + "/#{username}/mail")
@request = Net::HTTP::Post.new(uri.path)
- @request.body = multi_part(properties, message)
+ @request.body = multi_part(properties.to_s, message)
set_headers :migrate
@response = request(uri)
end
\ No newline at end of file