I am trying to send an XML file with a rest api POST. the api takes the xml and creates a new entitiy.
I am trying to open the file and then sending it through requests.
filename = 'test.xml'
response = requests.post(api_url, data=json.dumps(open(filename).readlines()))
But getting the 503 (API not able to get the right input). My intention is to send this XML as it is to api.
If I don't do json.dumps, I get ValueError: too many values to unpack