def getRecognitionResult(self, apiName, seqValue):
query = self.getBasicQueryString(apiName, seqValue) + "&stop=1"
'''Request speech recognition service by HTTP GET'''
url = str(self.apiBaseUrl) + "?" + str(query)
req = urllib.request.Request(url,headers = {'Cookie': self.cookies})
with urllib.request.urlopen(req) as f:
getResponse = f.read().decode()
'''Now you can check the status here.'''
print("Sending 'GET' request to URL : " + self.apiBaseUrl)
print("get parameters : " + str(query))
print("Response Code : " + str(f.getcode()))
'''Get the response'''
return str(getResponse)
__init__.py 文件源码
python
阅读 23
收藏 0
点赞 0
评论 0
评论列表
文章目录