华为云http实现一句话识别,报错"code":2300006,"message":"Couldn't resolve host name"
·
我按照文档想实现http一句话识别接口,可是报错,无法连接:报错"code":2300006,"message":"Couldn't resolve host name"
2300006 域名解析失败
错误信息
Couldn’t resolve host name.
错误描述
服务器的域名无法解析。
可能原因
1.传入的服务器的URL不正确。
2.网络不通畅。
处理步骤
1.请检查输入的服务器的URL是否合理。
2.请检查网络连接情况
不明白是我的请求网址是不是有问题:
https://sis-ext.cn-north-4.myhuaweicloud.com/v1/24006b8776a84b93b387353e460dff86/asr/short-audio
globalThis.httpRequest.request("https://sis-ext.cn-north-4.myhuaweicloud.com/v1/24006b8776a84b93b387353e460dff86/asr/short-audio",
{
method: http.RequestMethod.POST,
header: {"X-Auth-Token": globalThis.token,
"Content-Type": "application/json;charset=UTF-8"
},
extraData: {
"config": {
"audio_format": "pcm16k16bit",
"property": "chinese_16k_general",
"add_punc": "yes",
"digit_norm": "yes",
"need_word_info": "no"
},
"data": result1
},
readTimeout: 60000,
connectTimeout: 60000
}, (err, data) => {
if (!err) {
console.info('success');
console.info(JSON.stringify(data));
} else {
console.info('error:' + JSON.stringify(err));
}
});
更多推荐
所有评论(0)