2

Harvest API 的以下 curl 请求正在生成“我们很抱歉,但出现了问题”错误。知道我可能做错了什么吗?也许我没有正确格式化 XML POST?我已经能够使用 API 成功执行 GET 请求。我在下面的代码中替换了我的特定域和用户帐户信息。

curl https://domain.harvestapp.com/daily/add/ -H 'Content-Type: application/xml' -H 'Accept: application/xml' -u user@domain.com: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>"
4

1 回答 1

2

我觉得你的格式有点不对劲

尝试这个 :

    curl https://domain.harvestapp.com/daily/add -H 'Accept: application/xml' -H 'Content-Type: application/xml' -u user@example.com:password -X POST -d "<request><notes>Test api support</notes><hours>3</hours><project_id type=\"integer\">12345</project_id><task_id type=\"integer\">23456</task_id><spent_at type=\"date\">Fri, 27 May 2011</spent_at></request>"
于 2011-05-27T19:35:14.930 回答