1
没有返回响应我有一个简单的龙卷风服务器运行的是这样的:龙卷风服务器self.write
import json
import suds
from suds.client import Client
import tornado.httpserver
import tornado.ioloop
import tornado.web
class MainHandler(tornado.web.RequestHandler):
def get(self):
url = "http://xx.xxx.xx.xxx/Service.asmx?WSDL"
client = Client(url)
resultCount = client.service.MyMethod()
self.write(json.dumps({'result_count':resultCount}))
application = tornado.web.Application([
(r"/", MainHandler),
])
if __name__ == "__main__":
http_server = tornado.httpserver.HTTPServer(application)
http_server.listen(6969)
tornado.ioloop.IOLoop.instance().start()
现在,我有一个调用这个龙卷风这样的代码jQuery的功能:
$.get("http://localhost:6969",
function(data){
alert(data);
$('#article-counter').empty().append(data).show();
});
对于我的生活,我不明白为什么数据(回应)是空白的。即使萤火虫显示一个空白的回应(虽然http状态是200)。任何人都有线索?