通过 REST 向 Discourse 发布新主题 - 403 Forbidden
Posting a new topic to Discourse via REST- 403 Forbidden
我正在 POST-ing 来自高级 REST 客户端的以下 URl 并得到 403 forbidden
响应。
http://[my discourse ip]/posts.json?title="Created from the advanced REST client"&category="2"&raw="A whole bunch of text about a topic"&api_key="[key from admin tab]"&api_username="[admin username]"
我通过引用 this, this, and this 构建了 URL(尽管我正在寻找与语言无关的解决方案)。我希望我错过了一些明显的东西。
为什么我作为管理员用户使用 api 密钥收到禁止响应?
(将我指向 How to reverse engineer the discourse api 将 不会 帮助我,我已经阅读了两遍)
您真的在 URL 参数中使用引号 ("...") 吗?这不是 URL 参数的样子。
在 ARC 中,您可以选择对参数进行编码(URL 字段旁边的下拉菜单),您应该在发送请求之前对其进行编码。没有引号。
您的 url 应如下所示:
http://[my discourse ip]/posts.json?title=Created+from+the+advanced+REST+client&category=2&raw=A+whole+bunch+of+text+about+a+topic&api_key=[key from admin tab]&api_username=[admin username]
我正在 POST-ing 来自高级 REST 客户端的以下 URl 并得到 403 forbidden
响应。
http://[my discourse ip]/posts.json?title="Created from the advanced REST client"&category="2"&raw="A whole bunch of text about a topic"&api_key="[key from admin tab]"&api_username="[admin username]"
我通过引用 this, this, and this 构建了 URL(尽管我正在寻找与语言无关的解决方案)。我希望我错过了一些明显的东西。
为什么我作为管理员用户使用 api 密钥收到禁止响应?
(将我指向 How to reverse engineer the discourse api 将 不会 帮助我,我已经阅读了两遍)
您真的在 URL 参数中使用引号 ("...") 吗?这不是 URL 参数的样子。 在 ARC 中,您可以选择对参数进行编码(URL 字段旁边的下拉菜单),您应该在发送请求之前对其进行编码。没有引号。 您的 url 应如下所示:
http://[my discourse ip]/posts.json?title=Created+from+the+advanced+REST+client&category=2&raw=A+whole+bunch+of+text+about+a+topic&api_key=[key from admin tab]&api_username=[admin username]