Table of Contents
Http client used by the mod helper
public class ModHelperHttp
Inheritance System.Object ModHelperHttp
The HttpClient instance
public static System.Net.Http.HttpClient Client { get; set; }
Asynchronously downloads from a url to the given file path, returning whether the operation was successful
public static System.Threading.Tasks.Task<bool> DownloadFile(string url, string filePath);
url
System.String
URL to download from
filePath
System.String
File path for the resulting file
System.Threading.Tasks.Task<System.Boolean>
Whether it was sucessful
Downloads and extracts the contents of a zip file into the Zip Temp directory, returning the file paths
of the extracted files
public static System.Threading.Tasks.Task<System.IO.DirectoryInfo> DownloadZip(string url, string path=null);
url
System.String
URL to download from
path
System.String
Path to unzip into, or null for using the zip temp directory
System.Threading.Tasks.Task<System.IO.DirectoryInfo>
Enumeration of extracted file paths, or null
Downloads a zip file directly into a zip archive
public static System.Threading.Tasks.Task<System.IO.Compression.ZipArchive> GetZip(string url);
url
System.String
System.Threading.Tasks.Task<System.IO.Compression.ZipArchive>