【发布时间】:2014-07-26 03:39:49
【问题描述】:
我收到 400 错误请求,将我的 JSON 发布到 Groups API。我假设这是因为我的帖子的 JSON 格式不正确。想知道是否有人已成功发布到组 API 并可以提供一些帮助。 XML 示例指示围绕内容。我需要包含帖子吗?
这是我的 JSON
{\"title\":\"Testing out the LinkedIn Share API with JSON\",\"content\":{\"title\":\"News Article\",\"submitted-url\":\"http%3a%2f%2fmysite.com%2fcontent.aspx%3fpage_id%3d5%26club_id%3d652588%26item_id%3d300\",\"description\":\"hey this is a description\"}}
这是我用来构建它的对象:
var post = new {
title = "Testing out the LinkedIn Share API with JSON",
content = new Dictionary<string, string>
{ { "title", title },
{ "submitted-url", encodedUrl },
{"description" , postdescription}
}
};
格式不正确的 JSON 对象会引发 400 Bad Request 错误吗?
【问题讨论】: