public async Task RenderAsync(ISpiderContainer container) { var storage = container.Application.Storage; using (var fs = await storage.CreateStreamAsync(GetFileName(container.Url.Source))) using (var writer = new StreamWriter(fs, Encoding.UTF8)) { writer.BaseStream.Position = writer.BaseStream.Length; writer.WriteLine(); writer.Write(container.RenderData(template)); } }
public async Task RenderAsync(ISpiderContainer container) { var client = new Client(); var data = container.RenderData(template); await client.PostAsync(postUri, data, data.StartsWith("{")? "application/json" : "application/x-www-form-urlencoded"); }