def METHOD_NAME(self, path, data, **queries):
    if isinstance(data, bytes):
        headers = {'Content-Type': 'application/octet-stream'}
    else:
        data = json.dumps(data).encode()
        headers = {'Content-Type': 'application/json'}
    headers['Content-Length'] = '%d' % len(data)
    code, json_result = self._submit_request(
        self.url + path,
        params=self._format_queries(queries),
        data=data,
        headers=headers,
        method='POST')
    if code in (200, 201, 202):
        return json_result
    raise Exception("({}): {}".format(code, json_result))