import tornado.web

class BaseHandler(tornado.web.RequestHandler):
    # 初始化映射关系


    def set_default_headers(self):
        self.set_header('Content-Type','application/json; charset=utf-8')
        self.set_header('Accept','application/json; charset=utf-8')
        self.set_header("Content-Type","text/html")


    def prepare(self):

        self.set_header('Content-Type','application/json;text/html; charset=utf-8')
        self.set_header('Accept','application/json; charset=utf-8')
        self.set_header('Content-type', 'application/json')

