I have a way to attach file as binary to ALM using REST API
URL = "https://some.almserver.com/qcbin/rest/domains/DOMAIN/projects/PROJECT/runs/<run-id>/attachments"
METHOD = "POST"
HEADERS = {
'cache-control': "no-cache",
"Slug": "some.html",
'Content-Type': "application/octet-stream"
}
def attach_to_run_step():
f = open("/path/to/some.html", "rb")
response = requests.post(URL, headers=HEADERS, cookies=cookies, data=f.read())
print(response.content)
I couldn't find any way to upload attachments which are in url format (from X website to ALM directly using REST) But from ALM UI, we have option to upload attachment using URL.
Expecting METHOD, HEADERS, Request payload to upload url to ALM.