Expanded Moderator sample. Also made JsonBody more robust, allowing the external 'data' wrapper to be passed in from the caller or added, depending on whether it is present or not. Also handle adding user-agents better, by concatenating them.
diff --git a/apiclient/oauth.py b/apiclient/oauth.py
index 2016dea..de20336 100644
--- a/apiclient/oauth.py
+++ b/apiclient/oauth.py
@@ -130,8 +130,11 @@
       if headers == None:
         headers = {}
       headers.update(req.to_header())
-      if 'user-agent' not in headers:
-        headers['user-agent'] = self.user_agent
+      if 'user-agent' in headers:
+        headers['user-agent'] += ' '
+      else:
+        headers['user-agent'] = ''
+      headers['user-agent'] += self.user_agent
       return request_orig(uri, method, body, headers,
                           redirections, connection_type)