code: def ajax(cls, url, param={}, method='get'):
          
          param = urllib.parse.urlencode(param)
          if method.lower() == 'get':
              req = urllib.request.Request(url + '?' + param)
          elif method.lower() == 'post':
              param = param.encode('utf-8')
              req = urllib.request.Request(url, data=param)
          else:
              raise Exception("invalid method '{}' (GET/POST)".format(method))
          rsp = urllib.request.urlopen(req)
          if rsp:
              rsp_json = rsp.read().decode('utf-8')
              rsp_dict = json.loads(rsp_json)
              return rsp_dict
          return None
docs: Get info by ajax
  
          Args:
              url: string
          Returns:
              dict: json decoded into a dict