Curl 没有指定url

Curl 没有指定url,curl,ibm-cloud,speech-to-text,Curl,Ibm Cloud,Speech To Text,我遵循本教程在IBM Bluemix中设置语音到文本服务: 我已经安装并测试了先决条件,但在尝试输入时出现了错误: curl -X POST -u <username>:<password> --header "Content-Type: audio/flac" --header "Transfer-Encoding: chunked" --data-binary @<path>audio-file.flac "https://stream.watsonpl

我遵循本教程在IBM Bluemix中设置语音到文本服务:

我已经安装并测试了先决条件,但在尝试输入时出现了错误:

curl -X POST -u <username>:<password>
--header "Content-Type: audio/flac"
--header "Transfer-Encoding: chunked"
--data-binary @<path>audio-file.flac
"https://stream.watsonplatform.net/speech-to-text/api/v1/recognize?continuous=true"
当我直接访问url时,我已经测试了用户名和密码,它成功了。我为音频文件输入的路径也是正确的,因为我刚刚复制了它

有人知道如何解决这个问题吗?
提前感谢!:)

您缺少新线路的转义。试着这样做:

curl -X POST -u "myusername":"mypassword" \
--header "Content-Type: audio/flac" \
--data-binary "@audio-file1.flac" \
--data-binary "@audio-file2.flac" \
"https://stream.watsonplatform.net/speech-to-text/api/v1/recognize?timestamps=true&word_alternatives_threshold=0.9&keywords=%22colorado%22%2C%22tornado%22%2C%22tornadoes%22&keywords_threshold=0.5&continuous=true"

好的,我在进入路径时忘记了双引号。但现在它返回以下HTML代码:

<HTML><HEAD>
<TITLE>Network Error</TITLE>
</HEAD>
<BODY>
<FONT face="Helvetica">
<big><strong></strong></big><BR>
</FONT>
<blockquote>
<TABLE border=0 cellPadding=1 width="80%">
<TR><TD>
<FONT face="Helvetica">
<big>Network Error (tcp_error)</big>
<BR>
<BR>
</FONT>
</TD></TR>
<TR><TD>
<FONT face="Helvetica">
A communication error occurred: "Connection refused"
</FONT>
</TD></TR>
<TR><TD>
<FONT face="Helvetica">
The Web Server may be down, too busy, or experiencing other problems preventing it from responding to requests. You may wish to try again at a later time.
</FONT>
</TD></TR>
<TR><TD>
<FONT face="Helvetica" SIZE=2>
<BR>
For assistance, contact your network support team.<br><br>Your request was categorized by Blue Coat Web Filter as 'Technology/Internet'. <br>If you wish to question or dispute this result, please click <a href="http://sitereview.bluecoat.com/sitereview.jsp?referrer=136&url=http://stream.watsonplatform.net/speech-to-text/api/v1/recognize?continuous=true">here</a>.
</FONT>
</TD></TR>
</TABLE>
</blockquote>
</FONT>
</BODY></HTML>

网络错误

网络错误(tcp\U错误)

发生通信错误:“连接被拒绝” Web服务器可能已关闭、太忙或遇到其他问题,无法响应请求。您可能希望稍后再试。
如需帮助,请联系您的网络支持团队。

Blue Coat Web Filter将您的请求归类为“技术/互联网”
如果您希望对此结果提出疑问或争议,请单击。
所有内容都是以单个命令的形式输入的吗?不,我将其粘贴到onceSorry中的Cmder中,不知何故,我没有意识到您回答了:P,但它告诉我:“curl:(6)无法解析主机“\”。您使用的是Windows吗?您还可以去掉那些转义字符,并将其作为一行程序发布。是的,我使用的是windows 7 64。不清楚您是否还有其他问题,因此您可能无法得到响应。如果这是一个新问题,你最好根据你的新问题场景发布一个新问题。
<HTML><HEAD>
<TITLE>Network Error</TITLE>
</HEAD>
<BODY>
<FONT face="Helvetica">
<big><strong></strong></big><BR>
</FONT>
<blockquote>
<TABLE border=0 cellPadding=1 width="80%">
<TR><TD>
<FONT face="Helvetica">
<big>Network Error (tcp_error)</big>
<BR>
<BR>
</FONT>
</TD></TR>
<TR><TD>
<FONT face="Helvetica">
A communication error occurred: "Connection refused"
</FONT>
</TD></TR>
<TR><TD>
<FONT face="Helvetica">
The Web Server may be down, too busy, or experiencing other problems preventing it from responding to requests. You may wish to try again at a later time.
</FONT>
</TD></TR>
<TR><TD>
<FONT face="Helvetica" SIZE=2>
<BR>
For assistance, contact your network support team.<br><br>Your request was categorized by Blue Coat Web Filter as 'Technology/Internet'. <br>If you wish to question or dispute this result, please click <a href="http://sitereview.bluecoat.com/sitereview.jsp?referrer=136&url=http://stream.watsonplatform.net/speech-to-text/api/v1/recognize?continuous=true">here</a>.
</FONT>
</TD></TR>
</TABLE>
</blockquote>
</FONT>
</BODY></HTML>