Trying to pull an archive of my public repo using this api:
Here’s the url:
Here’s my C# code:
using (HttpClient httpClient = new HttpClient())
var response = httpClient.GetAsync(url); var httpContent = response.Result.Content; return httpContent.ReadAsStringAsync(); }
When I save the response string to a disk file, I am unable to open it. Windows 10 reports that it is not a valid zip file. Perhaps I need to “massage” the response string first before saving? I have tried saving it with File.WriteAllText(), File.WriteAllBytes() and FileStream.Write(), but nothing works.
Would appreciate some pointers from the forum.