def xml2dict(xml): """Returns a dictionary from the input XML :type xml: unicode :param xml: The XML :rtype: dict :returns: the dictionary correspoding to the input XML """ xmlepured = remove_namespace(to_unicode(xml)) try: return xmltodict.parse(xmlepured) except ExpatError as e: raise FnapyResponseError(e)
def post(url, service, request): request = to_unicode(request).encode('utf-8') return requests.post(url + service, request, headers=HEADERS)