__init__.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:olami-api-quickstart-python-samples 作者: olami-developers 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号