Closed yunhenk closed 6 years ago
The data for req should be string other than bytes, ie: you need to decode after base64 encode. What's more, the encode method should be b64encode other than encodebytes. The right code looks like:
def tobase64(file_path):
f=open(file_path,'rb')
res=base64.b64encode(f.read())
f.close()
return res.decode()
Thanks for your report. Are you running this code in python 3 environment?
yes, python 3.5.2
[TencentCloudSDKException] code:AuthFailure.SignatureFailure message:The provided credentials could not be validated. Please check your signature is correct
i called the SpeechRecognition API, don't know why cause the upper exception, here is my code