我从我的电脑上使用Postman向我的端点发出查询请求,它能正常返回期望的结果。
但是由“代码片段”生成的代码却无法工作,可能是什么原因呢?
--那段代码不起作用。但在Postman中可行(同一台笔记本电脑)。
curl --location --request POST 'https://service' \
--header 'Ocp-Apim-Subscription-Key: myKey' \
--header 'Content-Type: audio/mpeg' \
--data-binary '@/path/audio_test.mp3'
错误:
curl: (28) 连接 <service> 的443端口超时
为了排除是我本地的问题,我尝试了另一个可以在Postman中正常工作且通过“代码片段”生成的服务。
-- 在Postman和我的控制台都可以工作 --
curl --location --request POST 'https://´service' \
--header 'Key: myKey' \
--header 'Content-Type: application/json' \
--data-raw '{"text":"myText",
"language": "en"
}
'
它返回了期望的结果
有人知道我该在哪里寻找吗?谢谢