Python Post Getting couldn't determine the boundary from the message
I found my problem - when sending a file I need the request to be files-data instead of data=data - not sure exactly what happens in the background but this resolved my issue
I have a python program in which I am trying to do a post sending file contents as a string.  I am doing the following:
header 'content-type':'multipart/form-data'
data {file1: filedata}
filedata is a string I build by reading a file putting the contents in the string
when I make the post call I get a 500 back and looking in the catalina log I see the error "couldn't determine the boundary from the message".
the thing is when I put this in insomnia it works properly and the catalina log shows the header had ; boundary=X-INSOMNIA-BOUNDARY appended to the content-type I defined
Why would this work for insomnia but not when I do it in python using requests?  This is my requests call (auth is set to None)
response = requests.post(url, data=data, headers=headers, auth=auth, timeout=REQUEST_TIMEOUT, verify=False)
headers = 'content-type':'multipart/form-data
data = {'timepunch': 'datastring'}