Consider this small code below:
var client = new HttpClient();
var multiForm = new MultipartFormDataContent();
var str = new StreamContent(File.OpenRead("movie.mp4"));
multiForm.Add(str, "to_upload", "1.mp4");
var response = await client.PostAsync("https://example.com/upload", multiForm);
As you can see I'm using StreamContent
and MultipartFormDataContent
to upload a file. My question is it is possible to somehow get the upload progress from HttpClient? Or any other way to get upload progress?