【发布时间】:2014-01-14 04:12:48
【问题描述】:
我正在尝试让本教程在 CMD 和 Windows Powershell (Windows 7 64) 中工作:http://www.elasticsearchtutorial.com/elasticsearch-in-5-minutes.html
第一个命令在 CMD 中已经不起作用:
curl -XPUT 'http://localhost:9200/blog/user/dilbert' -d '{ "name" : "Dilbert Brown" }'
我收到以下错误消息:
curl: (1) Protocol 'http not supported or disabled in libcurl
curl: (6) Could not resolve host: name
curl: (7) Failed to connect to port 80: Connection refused
curl: (6) Could not resolve host: Dilbert Brown
curl: (3) [globbing] unmatched close brace/bracket in column 1
在 Windows Powershell 中我得到:
{"error":"MapperParsingException[failed to parse]; nested: JsonParseException[Unrecognized token 'Dilbert': was expecting ('true', 'false' or 'null')\n at [Source: [B@132b73b; line: 1, column: 33]]; ","status":400}curl: (3) [globbing] unmatched close brace/bracket in column 7
相同的命令在 Cygwin 中没有任何问题。我必须如何编写命令才能使其在 CMD 和 Windows Powershell 中工作?
【问题讨论】:
标签: windows powershell curl cmd cygwin