【问题标题】:Post to Linkedin Groups API 400 Bad Request发布到 Linkedin Groups API 400 错误请求
【发布时间】: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 错误吗?

【问题讨论】:

    标签: c# json rest linkedin


    【解决方案1】:

    已解决。我的 Json 字符串搞砸了。缺少“发布”和一些 {}。

    如果有人最终阅读此内容,请确保您的网址已编码。在此处的 REST 控制台中测试您的 json 和示例字符串:

    https://developer.linkedin.com/rest-console.

    其他一些提示,以节省一些时间 - 如果它们是 2013 年之前的,请不要认真对待任何文档/支持帖子或 google 的解决方案。有一些非常糟糕/丑陋的东西漂浮在周围,应该删除.

    【讨论】:

      猜你喜欢
      • 2017-02-13
      • 1970-01-01
      • 1970-01-01
      • 2018-12-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-11-19
      • 1970-01-01
      相关资源
      最近更新 更多