不支持卷曲错误协议

时间:2018-01-26 00:07:48

标签: curl cmd

curl error

我试图通过生成REST API

从nexus存储库创建的组件中删除组件以进行删除
curl -X DELETE --header 'Accept: application/json' 'http://localhost:8081/service/siesta/rest/beta/components/sam'

我收到这些错误:

curl: (6) Could not resolve host: application
curl: (1) Protocol "'http" not supported or disabled in libcurl

1 个答案:

答案 0 :(得分:2)

Windows cmd命令提示符不支持单引号(')。您必须使用双引号(“)代替该shell。

您使用的单引号不会被shell剥离,而是传递给curl,它将它们作为参数的一部分读取,这肯定不是您想要的。

因此,您的命令行应该像这样写:

curl -X DELETE --header "Accept: application/json" "http://localhost:8081/service/siesta/rest/beta/components/sam"

或者,使用支持单引号的shell /系统。

相关问题