public class Base64UrlImageBuilder
{
    public required string ContentType { set; get; }

    public string Url
    {
        set
        {
            var httpClient = new HttpClient();
            var response = (httpClient.GetAsync(new Uri($"{value}"))).Result;
            var bytes = (response.Content.ReadAsByteArrayAsync()).Result;
            _fileContents = Convert.ToBase64String(bytes);
        }
    }

    private string _fileContents = string.Empty;

    public string FileContents
    {
        get
        {
            return _fileContents;
        }
    }

    public override string ToString()
    {
        //return $"data:{ContentType};base64,{FileContents}";
        return $"{FileContents}";
    }
}