python - IBM Speech to text api , unable to make a HTTP POST call -


i making python program supposed send small .wav audio clip , response , have tried several things unable make successful request till

more details : https://www.ibm.com/smarterplanet/us/en/ibmwatson/developercloud/apis/#!/speech-to-text/recognizesessionless

those have tried platform

please try code below:

import requests  url = 'https://stream.watsonplatform.net/speech-to-text/api/v1/recognize' username = '<username>' password = '<password>'  headers={'content-type': 'audio/wav'}  audio = open('./sheet.wav', 'rb')  r = requests.post(url, data=audio, headers=headers, auth=(username, password))  print(r.text) 

Comments