在tornado中设置http请求的响应头:
self.set_header("Content-Type","text/html");
告诉浏览器以html文件的形式解析此响应的body
ajax请求,设置rest的api响应头:
self.set_header("Content-Type","application/json");
ajax请求以json数据类型解析此响应的body
在tornado中设置http请求的响应头:
self.set_header("Content-Type","text/html");
告诉浏览器以html文件的形式解析此响应的body
ajax请求,设置rest的api响应头:
self.set_header("Content-Type","application/json");
ajax请求以json数据类型解析此响应的body