def METHOD_NAME(self, url, data=None):
    req = urllib.METHOD_NAME.Request(self.base_url + url)
    if data:
        data = json.dumps(data)
        data_bytes = data.encode("utf-8")
        req.add_header("Content-Type", "application/json; charset=utf-8")
        req.add_header("Content-Length", len(data_bytes))
        response = urllib.METHOD_NAME.urlopen(req, data_bytes)
    else:
        response = urllib.METHOD_NAME.urlopen(req)
    return json.loads(response.read())