2016-04-14 24 views
1

我试图通过卷曲发布一个XML的REST API:卷曲:POST XML数据到服务器[CMDLINE WINDOWS]

λ curl -X POST -H "Content-Type: application/xml" http://localhost/vcardservice -d '<?xml version='1.0' encoding='ISO-8859-1' standalone='yes'?><ns2:vCardRequestStore> 
    <vcardRequestList> <vcardRequest></vcardRequest></vcardRequestList></ns2:vCardRequestStore>' 

,但不工作

Error: 
    < was unexpected at this time. 

任何帮助赞赏。

+0

怪里面逃出双qoutes,因为是在Ubuntu的卷曲7.35.0这对我的作品。显然我得到一个404页面,但没有错误。所以我猜这是你的'vcardservice'的一个问题' –

+0

我在windows上... – thegio

回答

1

尝试用数据有效载荷

<?xml version=\"1.0\" encoding=\"ISO-8859-1\" standalone=\"yes\"?> ... 
+0

谢谢,解决我不得不添加双引号而不是单引号并在反斜杠中加引号 – thegio