curl POST XML 和 Harvest API
Harvest API 的以下curl 请求生成“我们很抱歉,但出了点问题”错误。知道我可能做错了什么吗?也许我没有正确格式化 XML POST?我已经能够使用 API 成功执行 GET 请求。我已在下面的代码中替换了我的特定域和用户帐户信息。
curl https://domain.harvestapp.com/daily/add/ -H 'Content-Type: application/xml' -H 'Accept: application/xml' -u [email protected]:password --data-urlencode "<request><notes>Test api support</notes><hours>3</hours><project_id type='integer'>1234567</project_id><task_id type='integer'>12345</task_id><spent_at type='date'>Fri, 25 Mar 2011</spent_at></request>"
The following curl request of the Harvest API is generating a "We're sorry, but something just went wrong" error. Any idea what I might be doing wrong? Perhaps I am not formatting the XML POST properly? I have been able to successfully execute GET requests with the API. I have replaced my specific domain and user account info in the code below.
curl https://domain.harvestapp.com/daily/add/ -H 'Content-Type: application/xml' -H 'Accept: application/xml' -u [email protected]:password --data-urlencode "<request><notes>Test api support</notes><hours>3</hours><project_id type='integer'>1234567</project_id><task_id type='integer'>12345</task_id><spent_at type='date'>Fri, 25 Mar 2011</spent_at></request>"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为你的格式有点不对,
试试这个:
I think your formatting is just a little bit off,
Try this :