Python 和 pubsubhubbub
我编写了一个快速的 http 服务器脚本来首先确认订阅并接收更新。我能够验证订阅并开始接收更新。通过这种方法,我可以将更新的提要项目打印到控制台,但谷歌的订阅者诊断显示收据失败。
这还不够吗?: (这是在 BaseHTTPServer.BaseHTTPRequestHandler 子类的处理程序类中)
def do_POST(self):
self.send_response(202)
self.end_headers()
stuff = self.rfile.read()
print stuff
谢谢。
I wrote a quick http server script to first acknowledge a subscription and receive updates. I was able to verify the subscription and start receiving updates. With this method I'm able to print the updated feed items to the console but google's subscriber diagnostics says the receipt failed.
Shouldn't this be enough?:
(this is inside a handler class subclassed with BaseHTTPServer.BaseHTTPRequestHandler)
def do_POST(self):
self.send_response(202)
self.end_headers()
stuff = self.rfile.read()
print stuff
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
所以状态码 204 看起来没问题。我想是因为我的响应中没有正文?无论如何,现在工作得很好。
如果有人知道我为什么需要那个特定的状态代码,我会很高兴得到评论。规格只是说 2xx。
So it seems with status code 204 it's fine. I guess because I have no body in the response? Anyway, working fine now.
I'd be greatful to get a comment if someone knows why I needed that particular status code. The spec just says 2xx.