I have a use-case where I'm sending an REST call to a server to generate a PDF document.
The document is returned in streaming format as an application/octet-stream.
The "entity" class appears to hold that response in an OpenEdge.Core.ByteBucket instance.
I haven't found any documentation on the ByteBucket class which leads to me asking here - is there a way to get the data out of that instance and into a PDF file?
I've done some more exploring and this gets me a copy of the PDF I'm looking for:
oPDFBucket = CAST(oResponse:Entity, OpenEdge.Core.ByteBucket). oPDFMemptr = oPDFBucket:GetBytes(). oFileOutput = NEW FileOutputStream("c:\tmp\bol.pdf"). oFileOutput:Write(oPDFMemptr:Value, 1, oPDFMemptr:Size). oFileOutput:Close().