AttributeError: 'Request' object has no attribute 'json', cherrypy 无法接收到json字符串,解决方法

        @cherrypy.expose

        @cherrypy.tools.accept(media="application/json")   #加入这个装饰器

        @cherrypy.tools.json_out()

        @cherrypy.tools.json_in()

        def upload_image_data(self):

          return cherrypy.request.json

posted @ 2018-08-16 13:40  anobscureretreat  阅读(3383)  评论(0编辑  收藏  举报