def jsonex_request(url, data, headers=None):
<EOL>url, headers = _parse_authentication(url)<EOL>headers['<STR_LIT:Content-Type>'] = '<STR_LIT:application/json>'<EOL>try:<EOL><INDENT>req = Request(url, headers=headers)<EOL>response = urlopen(req, jsonex_dumps(data))<EOL>res_str = response.read()<EOL>res = jsonex_loads(res_str)<EOL><DEDENT>except HTTPError as e:<EOL><INDENT>if '<STR_LIT:Content-Type>' in e.headers and e.headers['<STR_LIT:Content-Type>'] == '<STR_LIT:application/json>':<EOL><INDENT>res = jsonex_loads(e.read())<EOL><DEDENT>else:<EOL><INDENT>raise exc.ServerError('<STR_LIT>'.format(url, e))<EOL><DEDENT><DEDENT>except URLError as e:<EOL><INDENT>raise exc.ConnectionError('<STR_LIT>'.format(url, e))<EOL><DEDENT>if '<STR_LIT:error>' in res:  <EOL><INDENT>raise res['<STR_LIT:error>']  <EOL><DEDENT>return res<EOL>
Make a request with JsonEx
    :param url: URL
    :type url: str
    :param data: Data to POST
    :type data: dict
    :return: Response
    :rtype: dict
    :raises exc.ConnectionError: Connection error
    :raises exc.ServerError: Remote server error (unknown)
    :raises exc.ProviderError: any errors reported by the remote