I have this cURL:
curl -X POST http://user:pass@blabla.com:8080/job/myproject/config.xml --data-binary "@new_config.xml"
I am basically trying to set a new config for a Jenkins installation by changing the pre-existing config.xml file. I am trying to convert it to something like this in order to use it more flexibly in my code:
url = "http://host:8080/job/myproject/config.xml"
auth = ('user','pass')
payload = {"--data-binary": "@new_config.xml"}
headers = {"Content-Type" : "application/xml"}
r = requests.post(url, auth=auth, data=payload, headers=headers)
I know that I am using incorrectly the payload and the headers.How should I change them? I run it and I take a 500 responce code.
I read this post , but I am struggling to apply it in my case.