invoke

suspend operator fun invoke(urlString: String): ByteArray?

Asynchronously downloads an image from the given urlString.

This function performs a GET request and handles the following HTTP status codes:

  • 200 (OK)

  • 404 (Not Found)

  • 429 (Rate Limit)

  • 500 (Server Error)

Return

A ByteArray containing the image data if the request is successful, otherwise null.

Parameters

urlString

The URL of the image to download.