@
ClericPy 嗯,自己 print 了 params 。是一个 str 的类型,故使用字符串拼接的方式把它拼接了,然后就搞定了
with open("1.jpg","rb") as f:
base64_data = base64.b64encode(f.read())
#print(base64_data)
#print(type(base64_data))
req = models.GeneralBasicOCRRequest()
a = "{\"ImageBase64\":\""
b = "\"}"
params = a + base64_data + b