I have figured out from searching around how to make a REST GET call to retrieve a PDF. I get back a success response and the .responseText looks like it has got all the good stuff inside it.
Code: Select all
GetFile:
oWhr := ComObjCreate("WinHttp.WinHttpRequest.5.1")
oWhr.Open("GET", "https://my URL to get file", false)
oWhr.SetRequestHeader("Authorization", "Basic ABC123")
oWhr.Send()
TheResponse := % oWhr.responseText
Default application is fine (Adobe), if I have to specify path to Adobe.exe that is also fine, but I'm not sure how to go about doing so.
Would prefer not to save the file and have the user open, want it to be automatic as GetFile is called from a button and the next thing the user should see is the PDF open in Adobe, no "save as" prompts or anything.
Hopefully someone can point me in the right direction!