我试图使用以下代码发布更新到WeSub,但我收到错误
集线器模式无效
function sendWebSubNotification($topicUrl) {
$response = Http::post("https://pubsubhubbub.appspot.com/", [
'hub.mode' => 'publish',
'hub.url' => $topicUrl,
], [
'Content-Type' => 'application/x-www-form-urlencoded'
]);
echo $response->getBody();
if ($response->ok()) {
// Ping successful
return true;
} else {
// Ping failed
return false;
}
}
1条答案
按热度按时间0sgqnhkj1#
在Laravel中使用asForm()发送URL编码的POST请求: