GetStreamAsync() Stream Always Null [Answered]

I'm getting a URI from json on my computer and trying to download an image from it.
Everything works up to actually putting something in requestBodyStream. It is forever null.
        public static async Task DownloadFunction(List<Card> cards)
        {
            foreach(Card card in cards)
{
                var requestBodyStream = await client.GetStreamAsync(card.ImageUris.Small);
                var fileStream = File.Create($@"C:\Users\samue\Desktop\MTGImage\{card.Name}.jpg");

                await requestBodyStream.CopyToAsync(fileStream);
                await fileStream.FlushAsync();
            }
        }

The next debug Step Into would be to get the URI, which it shows by going to the model. Then it seems like it skips the next three lines of code and goes to the second object in the foreach loop. Pressing Step Into again on the last item in the list of cards finishes the program. Nothing is ever downloaded.
unknown.png
Was this page helpful?