Fix str/unicode issue in batch media requests.
Reviewed in http://codereview.appspot.com/5569055/.
diff --git a/apiclient/http.py b/apiclient/http.py
index 4563bd1..c8a8cd4 100644
--- a/apiclient/http.py
+++ b/apiclient/http.py
@@ -513,7 +513,7 @@
if request.body is None:
body = body[:-2]
- return status_line + body
+ return status_line.encode('utf-8') + body
def _deserialize_response(self, payload):
"""Convert string into httplib2 response and content.
@@ -650,7 +650,7 @@
boundary, _ = content.split(None, 1)
# Prepend with a content-type header so FeedParser can handle it.
- header = 'Content-Type: %s\r\n\r\n' % resp['content-type']
+ header = 'content-type: %s\r\n\r\n' % resp['content-type']
for_parser = header + content
parser = FeedParser()