Dear Team,
I am facing a issue regarding Uploading a template in nifi using Rest-Api
commands in python .
This is my sample code :
new_process_group_id='c0c352f4-0183-1000-bc0c-7b0156ac0f6e'
headers = {"Content-Type": "multipart/form-data",
"x-api-key": "xxxxxx-xxxxx-xxxx-xxxx-xxxxxxxx"}
file = {"template": open("kafka.xml", "rb")}
res = requests.post(
'http://192.168.1.103:7777/nifi-api/process-groups/'+new_process_group_id+'/
templates/upload/',data={},
files=file ,headers=headers)
print('status',res)
print(res.text)
I am getting output:
$status <Response [400]>
$HTTP 400 Bad Request
Can anyone help me in this issue.
Thanks & Regards
Harshit Varshney