Python - Unable to parse XML data
I am trying to insert data into contacts, but I am getting this error. Can anyone help what is going wrong
b'<?xml version="1.0" encoding="UTF-8" ?>\n<response uri="/crm/private/xml/Contacts/insertRecords"><error><code>4835</code><message>Unable to parse XML data</message></error></response>\n'
Here is the code:
import urllib.request
authtoken = '####################'
params = {'authtoken':authtoken,'scope':'crmapi','newFormat': '1','xmlData':'<Contacts><row no="11"><FL val="CONTACT NAME">Hannah Montana</FL><FL val=EMAIL">
hannah@hm.com</FL><FL val="PHONE">8889874561</FL></row></Contacts>'}
#<FL val="ACCOUNT NAME"> qwerty</FL> <FL val="CONTACT OWNER"> LOBSTER </FL>
data = urllib.parse.urlencode(params).encode("utf-8")
#print (data)
request = urllib.request.Request(final_URL,data)
response = urllib.request.urlopen(request)
xml_response = response.read()
print (xml_response)