zanemx's Forum Posts

  • 1 posts
  • I'm working with the poster of this thread. We've found the answer. The answer lies in the response object. You must specify which construct 2 datatype you want to dump your json data to. In our case we had to set a key of 'c2dictionary':True and set your game related data to an key 'data:{}'.

    def post(self):

             self.response.headers['Access-Control-Allow-Origin'] = '*'

             # logging.info(self.request.get('name'))

             # self.response.out.write(self.request.get('name'))

             name = self.request.get('name')

             data = {

                  'c2dictionary':True,

                  'data':{

                       'success':True,

                       'content':name

                  }

             }

             

             logging.info(data)

             self.response.out.write(json.dumps(data))

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 1 posts