Hello i want to send a multipart/form-data
form to a pubsub
i have the following data:
data = {'uuid' : mId, 'token' : 'd8sd87dvttd', 'objId': str(objData[1].objectID)}
img = cv2.imencode('.jpg', objData[1].getImage())[1].tostring()
post_data = { 'image' : img }
future = self.publisher.publish(
self.topic_path, files = json.dumps(post_data).encode('utf-8'), data=json.dumps(data).encode('utf-8'), type="data1"
)
this code returns the following error:
TypeError: Object of type 'bytes' is not JSON serializable
any one can help me ? i cant find any example of how to send images to pubsub google.