我正在尝试学习一些基本的 Slack API 知识,并开始为我正在构建的应用程序构建一个 webhook。
我有以下代码:
$scope.postToSlack = function(){
$http({
url: 'https://hooks.slack.com/services/xxx/xxxx/xxxxx',
method: "POST",
payload:{"text": "This is a line of text in a channel.\nAnd this is another line of text."}
})
.then(function(response) {
console.log(response)
},
function(response) {
console.log(response)
});
}
但是不断收到 500 错误,说没有收到有效负载。
关于为什么这不起作用的任何想法?