I am new to c# and react. I am using the following method to convert image url to bytes
return Convert.ToBase64String(bytes);
but I am getting an error which says
cannot convert from
System.Threading.Tasks.Task<byte[]>
tobyte[]
This is the method:
[HttpGet]
[Route("GetImages")]
public IHttpActionResult GetImages()
{
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
WebProxy myproxy = new WebProxy("corpproxy1.tatasteel.com", 80);
myproxy.BypassProxyOnLocal = false;
//myproxy.UseDefaultCredentials = true;
HttpClientHandler handler = new HttpClientHandler()
{
Proxy = myproxy
};
using (var client = new HttpClient(handler))
{
var bytes =
client.GetByteArrayAsync("https://firebasestorage.googleapis.com/v0/b/tsl-coil-
qlty-monitoring-dev.appspot.com/o/1a60ce3b-eddf-4e72-b2af-b6e99873e926?
alt=media&token=61399a02-1009-4bb9-ad89-d1235df900e4");
return Convert.ToBase64String(bytes);
}
}
How do I correct this error?