Yes it was me putting dummy code into my question... Sorry...
I did figure out the problem just a few minutes ago, however.
Turns out the URL string had quotes around it. Oops...
So my URL variable contained "https://my.domain.com/imagefile.jpg" *including* the quotes... Once I removed the quotes from the string, it works.
Thanks,
L.