我有一个扭曲的网络应用程序。我想为GET请求调用一个Html文件(我的Html文件在运行Twisted应用程序的同一个文件夹中)
class Root(resource.Resource):
isLeaf = False
def render_GET(self, request):
return self.returnResponse(request)
def returnResponse(self, request):
request.setHeader(b"content-type", b"text/html")
return File("Info.html")
site = Root()
site.putChild('cache', NetworkCacheManager())
endpoints.serverFromString(reactor, "tcp:port=8080:interface=0.0.0.0").listen(server.Site(site))
reactor.run()
当我运行服务器时,我收到500个错误
^{pr2}$怎么了?在
我把它修好了
相关问题 更多 >
编程相关推荐