uriBase += '?' + arg_data
body = None
else:
- body = arg_data
+ body = arg_data.encode('utf8')
req = urllib.request.Request(uriBase, body, headers)
try:
handle = urllib.request.urlopen(req)
if "json" == self.format:
- res = json.loads(handle.read())
+ res = json.loads(handle.read().decode('utf8'))
return wrap_response(res, handle.headers)
else:
- return wrap_response(str(handle.read()), handle.headers)
+ return wrap_response(
+ handle.read().decode('utf8'), handle.headers)
except urllib.error.HTTPError as e:
if (e.code == 304):
return []