【发布时间】:2014-04-24 23:50:30
【问题描述】:
我正在尝试通过 Item Web Api 创建一个项目,但我无法弄清楚我的调用出了什么问题。
模板 ID 和父 ID 一样存在。
发布:
POST /-/item/v1/?name=Foo&template=%23%7b57ABCEB7-25E5-4F73-88D8-9E66E79EA87C%7d%23&sc_database=master&payload=Content&fields=DataTest&sc_itemid=%23%7b110D559F-DEA5-42EA-9C1C-8A5DF7E70EF9%7d%23 HTTP/1.1
X-Scitemwebapi-Username: sitecore\admin
X-Scitemwebapi-Password: b
Content-Type: application/x-www-form-urlencoded
Host: sandbox
Content-Length: 14
Expect: 100-continue
Proxy-Connection: Close
DataTest=Value
回应:
HTTP/1.1 200 OK
Cache-Control: no-cache, no-store
Pragma: no-cache
Content-Type: application/json; charset=utf-8
Expires: -1
Server: Microsoft-IIS/8.0
X-Powered-By: ASP.NET
Date: Wed, 19 Mar 2014 00:25:34 GMT
Content-Length: 65
{"statusCode":500,"error":{"message":"Template item not found."}}
有什么想法吗?
非常感谢!
【问题讨论】:
-
您是否尝试从
template和sc_item参数中删除%23(#)?如果失败,请尝试使用相对模板路径,看看是否有效 -
完美,我没有注意到这个额外的标志。发布为答案,以便我可以将问题标记为已回答。 Tks