public static TusBuild DefaultTusClientBuild(Uri tushost, string clientName = "") { TusClientOption tusClientOption = new TusClientOption { TusHost = tushost, ClientName = string.IsNullOrEmpty(clientName) ?"tusClient" : clientName }; IServiceCollection services = new ServiceCollection(); services.AddHttpClient(tusClientOption.ClientName, c => { c.DefaultRequestHeaders.Add("Tus-Resumable", "1.0.0"); }); services.AddTransient <ITusCore, Tus>(); services.AddTransient <ITusExtension, Tus>(); tusClientOption.Servces = services; TusBuild tusBuild = new TusBuild(tusClientOption); return(tusBuild); }
public TusBuild(TusClientOption tusClientOption) { _tusClientOptions = tusClientOption; }