get base64 content from an URL in groovy

PHOTO EMBED

Wed Feb 01 2023 10:33:28 GMT+0000 (Coordinated Universal Time)

Saved by @j33x70 #groovy #base64

URL internalURL = new URL(url)
return internalURL.openConnection().inputStream.withCloseable {
  it.bytes.encodeBase64();
}
content_copyCOPY