I can upload files and their metadata (JSON object) via postman successfully.
Image attached.
However, my Python doesn't work and it is giving an error:
import requests
url = "https://localhost:8888/dev/java-app-documents/v1/account/P00001547/documents"
payload={'metadata': '{"brand": "AB","customerNumber": "0000001","documentType": "WELCOME","EndDate": "2023-03-30T14:48:28.032Z","StartDate": "2022-03-30T14:48:28.032Z"}'}
files=[('file',('Welcomen.pdf',open('C:/Users/XXX/Downloads/Welcomen.pdf','rb'),'application/pdf'))]
headers = {"Content-type": "multipart/form-data; boundary='asdff'"}
response = requests.request("POST", url, headers=headers, data=payload, files=files)
print(response.status_code, response.text)
Error is getting as :
"summary":"Generic exception","detail":"Required request part 'metadata' is not present"...
Error Code: 400