I changed to %Stream.FileBinary is you suggested and changed the response.CopyFrom() to

while 'https.HttpResponse.Data.AtEnd {
response.Write($zcvt(https.HttpResponse.Data.ReadLine(), "O", "UTF8"))

and now it works perfectly. Thanks a lot!

It looks like this only checks if the dependant class exists and is properly compiled, but does not actually trigger a recompile of that class.

Thanks. This worked perfectly. Is there any list available with methods like this one? The Caché documentation does not contain any results for a search on OnCompile and even looking in the source code it's only used once in %SOAP.WebBase. How do you even know this exists?