【问题标题】:What format of url is this with the colon almost in the end - https://speech.googleapis.com/v1p1beta1/speech:longrunningrecognize这是什么格式的网址,几乎最后是冒号 - https://speech.googleapis.com/v1p1beta1/speech:longrunningrecognize
【发布时间】:2019-06-10 13:02:57
【问题描述】:

我正在尝试在这里使用谷歌文本到语音 api:https://cloud.google.com/speech-to-text/docs/async-recognize#speech-async-recognize-gcs-protocol

下面有这个url格式

 https://google-speech-api-base-urlspeech:longrunningrecognize

这个带冒号(:)的URL格式到底是什么?

当我尝试点击这个 URL 时,它在运行测试用例时给了我一个错误。无效的 URI。端口无效?

但谷歌官方文档说这是一个有效的网址?这个怎么用?

【问题讨论】:

    标签: url google-cloud-platform


    【解决方案1】:

    这种格式的 URL 称为 gRPC 转码语法。您的第一个 URL 是 invlaid ,因为它位于相对路径引用的第一个路径段中。

    https://google-speech-api-base-urlspeech:longrunningrecognize

    此网址无效,而下面的https://speech.googleapis.com/v1/speech:longrunningrecognize 运行良好。

    尝试将您的网址更改为类似
    https://google-speech-api-base-url/speech:longrunningrecognize。它会起作用的。

    【讨论】:

      【解决方案2】:

      我查看了您引用的文档页面,但无法看到/找到如下所示的 URL:

      https://google-speech-api-base-urlspeech:longrunningrecognize
      

      但是,我确实找到了一个表单的 URL:

      https://speech.googleapis.com/v1/speech:longrunningrecognize
      

      看起来完全有效。

      可以在此处找到此 REST 请求的文档:

      https://cloud.google.com/speech-to-text/docs/reference/rest/v1/speech/longrunningrecognize

      你的阅读和理解有错误吗?

      显然冒号 (:) 在 URL 的路径部分是合法的:

      Are colons allowed in URLs?

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2021-03-24
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-10-20
        • 1970-01-01
        • 2012-09-25
        相关资源
        最近更新 更多