I am trying to attach a pdf to a service request using below Python code:
========================================================
import requests
import urllib.request
headers3 = {"Content-Disposition": "multipart/form-data", "Content-Type":"multipart/form-data", "Cookie":"JSESSIONID="+"C1FB8D0318D1F8851495124442C3226F.inst05us-autoscaleapp-001092"}
url = “https://company.sysaidit.com/api/v1/sr/attachment"
pdfurl=”https://xx.com/a.pdf”
pdfFile = urllib.request.urlopen(pdfurl, data=None, timeout=60)
file = {"file": pdfFile}
attachmentResponse = requests.post(url=attachmentUrl, files=file, headers=headers3)
print(attachmentResponse.text)
=========================================================
I gett below error:
HTTP Status - 500 – Internal Server Error