- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我无法使用 curl 访问 IBM Bluemix 上的语音到文本 API!我使用 curl 尝试了文档中的无 session 请求示例,但没有成功;我收到一条无效的用户 ID/密码消息。
这是我得到的错误:
"{ "code" : 401 , "error" : "Not Authorized" , "description" : "2016-10-08T15:22:37-04:00, Error ERCDPLTFRM-DNLKUPERR occurred when accessing https://158.85.132.94:443/speech-to-text/api/v1/recognize?timestamps=true&word_alternatives_threshold=0.9&continuous=true, Invalid UserId and/or Password. Please confirm that your credentials match the end-point you are trying to access. A common error is trying to use credentials from an experimental or beta release against a GA release or vice versa" } "
谁能给我一个工作示例,说明如何使用 curl 获取对语音到文本 api 的 api 无 session 请求?
最佳答案
无 session 调用的文档可用 here .
确保您创建了一个 Watson Speech-to-Text 服务实例并使用来自该服务的凭证(而不是您的 Bluemix 用户 ID 和密码)。
您可以在 Bluemix UI 中创建服务并获取凭据,也可以通过命令行创建它:
$ cf create-service speech_to_text standard my_service
然后您可以创建服务凭证并获取它:
$ cf create-service-key my_service credentials-1
$ cf service-key my_service credentials-1
Getting key credentials-1 for service instance my_service as adasilva@us.ibm.com...
{
"password": "FJXUG6????",
"url": "https://stream.watsonplatform.net/speech-to-text/api",
"username": "147e438e-f633-4e40-8351-aaaaaaaaaa"
}
然后您可以在您的 curl 脚本中使用上面的用户名和密码。请参阅下面的 curl 命令和结果(出于安全考虑,我屏蔽了用户名、密码和其他字段):
$ curl -X POST -v -u '80062070-1f88-4943-9a2a-aaaaaaa':'hwtTg???????' \
> --header 'Content-Type: audio/flac' \
> --data-binary @audio-file1.flac \
> 'https://stream.watsonplatform.net/speech-to-text/api/v1/recognize?timestamps=true&continuous=true'
* Trying 158.85.132.94...
* Connected to stream.watsonplatform.net (158.85.132.94) port 443 (#0)
* TLS 1.2 connection using TLS_RSA_WITH_AES_256_GCM_SHA384
* Server certificate: *.watsonplatform.net
* Server certificate: GeoTrust SSL CA - G3
* Server certificate: GeoTrust Global CA
* Server auth using Basic with user '80062070-1f88-4943-9a2a-aaaaaaa'
> POST /speech-to-text/api/v1/recognize?timestamps=true&continuous=true HTTP/1.1
> Host: stream.watsonplatform.net
> Authorization: Basic ODAwNjIwNzAtMWY4OC00OTQzLTlhMmEtYzE0OWVmOTJkM2IyOmh3dXXXXXX==
> User-Agent: curl/7.43.0
> Accept: */*
> Content-Type: audio/flac
> Content-Length: 48363
> Expect: 100-continue
>
< HTTP/1.1 100 Continue
< X-Note: Gateway Ack
* We are completely uploaded and fine
< HTTP/1.1 200 OK
< X-Backside-Transport: OK OK
< Connection: Keep-Alive
< Transfer-Encoding: chunked
< Session-Name: LBBROMXYTJZKKEGE-en-US_BroadbandModel
< X-Content-Type-Options: nosniff
< Content-Disposition: inline; filename="result.json"
< X-XSS-Protection: 1
< Date: Sat, 08 Oct 2016 22:45:02 GMT
< Via: 1.1 c6a59f5, 1.1 022614b, HTTP/1.1 d941b9b
< Content-Type: application/json
< Server: -
< Set-Cookie: Watson-REMOVED; path=/speech-to-text/api; secure; HttpOnly
< X-Client-IP: 71.70.244.18
< X-Global-Transaction-ID: 775715492
< X-DP-Watson-Tran-ID: stream-dp02-775715492
<
{
"results": [
{
"alternatives": [
{
"timestamps": [
[
"the",
0.03,
0.09
],
[
"latest",
0.09,
0.6
],
[
"weather",
0.6,
0.85
],
[
"report",
0.85,
1.52
]
],
"confidence": 0.98,
"transcript": "the latest weather report "
}
],
"final": true
}
],
"result_index": 0
* Connection #0 to host stream.watsonplatform.net left intact
关于curl - 如何使用 curl 访问 IBM speech-to-text api?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39936567/
IBM Watson 和 IBM Inforsphere BigInsights (IBM Hadoop)/Streams 之间有什么区别? Watson 带来了 BigInsights 无法提供的哪
据我所知,Rational 是一种测试工具,而 Rational Rose 是一种建模工具。 最佳答案 Rational 是一家为软件开发生命周期制作工具的公司。 Rational Rose 就是这样
我尝试将 ibm-eventstreams-dev v 0.1.1 安装到 IBM Cloud Private 中,但收到一条错误消息: 内部服务错误:图表与 Tiller v2.6.0 不兼容 最佳
我正在尝试配置连接到集群MQ的集群Websphere应用程序服务器。 但是,我所掌握的信息是两个具有不同主机名,服务器通道和队列管理器的MQ实例的详细信息,这些主机名属于同一MQ集群名称。 在Webs
我想问问你们中的一些聪明人 :) 是否可以在 IBM Connections 文件中使用目录结构。还有图书馆,但我无法通过 webdav/smdb 映射它,也许这是关于我的信息差距,但我可以安装桌面插
我一次又一次地读到 IBM i 是一个支持多种编程语言的现代系统。除了 COBOL 和 RPG 之外,我如何确定哪些可供我使用? 维基百科上提供了一份 list ,我对 C、C++、BASIC、Sma
是否可以将 IBM HTTP 服务器设置为非 IBM Websphere 应用程序服务器(Glassfish、Apache Tomcat 或其他 Java 应用程序服务器)的前端?IBM 支持吗?我试
我有一个在 IBM Bluemix 上运行的简单 JSF 应用程序,与以下 J2EE 依赖项配合良好。 javax javaee-web-api 6.
我正在查看一个 RPG 程序。有一些这样的子程序:有没有工具哪个会将其创建为一个过程,可以在单独的过程中使用? C Eval FinQty# = 0
我正在设计一个新的体系结构大数据,我的客户将其作为IBM MQ代理使用。我们曾经在大数据架构中与Kafka一起工作,因为我想它比其他选择更快,更可靠,更强大,并且因为风暴和火花流在Kafka中更容易工
我偶然发现了一些 FMTDTA,它似乎是一种查询/排序语言,早于旧 RPG 系统中的 SQL。我试图解开它的用法。 例子: 物理文件布局: ORNO S 9 0 1
除了许可之外,IBM Worklight 的企业版和消费者版之间在功能方面是否存在任何差异? 最佳答案 企业版的销售目的是在组织内使用 (B2E)。许可证是“每台设备”。消费者版旨在以 B2C 的形式
我希望使用 IBM Worklight v5.0.5 Fix pack 1 设置 Eclipse 开发环境。 我可以获得有关旧版本 Worklight 的安装链接的一些指示吗? 最佳答案 查看下面的可
是否可以保留已检索且不再位于队列中的消息历史记录(包含消息内容将是完美的)? 在应用程序中,我可以看到发送者何时尝试将消息放入队列以及接收者何时尝试拾取消息,但我想查看消息何时真正到达队列以及消息何时
我正在向远程队列发送消息,但我无法控制该队列。 我发送一个 xml 文件作为消息,但是当应用程序读取消息时,它会得到一个消息头,例如 jms_text \0\0\0lqueue:///TEST128
在什么情况下队列管理器可能会失去与集群环境中存储库的连接?我的环境中队列管理器经常失去与存储库的连接,我需要刷新集群来修复此问题并重新建立与集群中其他队列管理器的通信。 我们的集群有 100 个队列管
我们正在为助手实现 Watson 技术,以帮助某些用户。 对话有些复杂,有时需要针对某些问题做跳答,这样做的坏处是用户可以再问一遍问题,以防不明白这就是问题所在。 当想进入后续进入的节点时,该节点进行
我们有一个启用了 DevOps 交付管道的 NodeJS Cloud Foundry 应用程序。 最初,我们将管道设置为使用 Bluemix 中交付管道的 Active Deploy 扩展来部署应用程
请注意,此问题特定于“IBM DB2 for i”,即 IBM i 操作系统的 version of DB2 . 下面的屏幕截图显示了一个故意错误的 INSERT 语句,它产生了 SQL0407 的
我想使用 IBM Websphere MQ 客户端 v7.5。我正在编写独立的 JMS 客户端应用程序来发送和使用来自 IBM WebsphereMQ 服务器的消息(它在其他地方运行,但我有权发送/接
我是一名优秀的程序员,十分优秀!