curl -s --ssl-no-revoke -H“授权:承载$(gcloud auth应用程序默认打印访问令牌)” https://speech.googleapis.com/v1/speech:recognize -d @ sync-request.json> output.txt
运行此命令时,出现错误:
{
"error": {
"code": 401,
"message": "Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.",
"status": "UNAUTHENTICATED"
我以前曾在Mac上成功运行过。我已经获取了我的.JSON文件,并根据要求将其放入环境变量中。我不确定在这里做什么。