When using the upload or upload_image function,
TypeError: POST data should be bytes or an iterable of bytes. It cannot be of type str.
Solved in my case by changing generateRequest function when method is post or put to below;
if method == 'PUT' or method == 'POST':
if (hasattr(data, 'encode')):
result = urllib2.urlopen(request, data.encode("utf-8"))
else:
result = urllib2.urlopen(request, data)
When using the upload or upload_image function,
TypeError: POST data should be bytes or an iterable of bytes. It cannot be of type str.Solved in my case by changing generateRequest function when method is post or put to below;