/// <summary> /// Initializes a new instance of the <see cref="BrowserContextMultipartFormData"/> class. /// </summary> /// <param name="configuration">The configuration that should be used to create the multipart/form-data encoded data.</param> /// <param name="boundaryName">Boundary name to be used</param> public BrowserContextMultipartFormData(Action<BrowserContextMultipartFormDataConfigurator> configuration, string boundaryName) { this.boundaryName = boundaryName; this.Body = new MemoryStream(); var configurator = new BrowserContextMultipartFormDataConfigurator(this.Body, boundaryName); configuration.Invoke(configurator); this.TerminateBoundary(); this.Body.Position = 0; }
/// <summary> /// Initializes a new instance of the <see cref="BrowserContextMultipartFormData"/> class. /// </summary> /// <param name="configuration">The configuration that should be used to create the multipart/form-data encoded data.</param> /// <param name="boundaryName">Boundary name to be used</param> public BrowserContextMultipartFormData(Action <BrowserContextMultipartFormDataConfigurator> configuration, string boundaryName) { this.boundaryName = boundaryName; this.Body = new MemoryStream(); var configurator = new BrowserContextMultipartFormDataConfigurator(this.Body, boundaryName); configuration.Invoke(configurator); this.TerminateBoundary(); this.Body.Position = 0; }