Gets or sets the string that will be used as the boundary between input elements (including the -- prefix), when encoding this Form as multipart/form-data.
Namespace: Facilita.WebAssembly: clrWebBrowser (in clrWebBrowser.dll) Version: 9.5.8.37 (1.0.0.0)
Syntax
Field Value
The string that will be used as the boundary between input elements (including the -- prefix), when encoding this Form as multipart/form-data.Examples
// Populate form with data Form form = previousResponse.ExtractForm("myForm"); form.GetInputElement("input1").Value = "value1"; form.GetFileElement("files-to-upload[]").AddFile("image.bmp", @"C:\dataFiles\image.bmp", "image/bmp"); form.GetFileElement("files-to-upload[]").AddFile("image2.bmp", @"C:\dataFiles\image2.bmp", "image/bmp"); // Set the multipart boundary for the form form.MultipartFormBoundary = "--multipart-form-boundary"; // Send the POST request Request request = WebBrowser.CreateRequest(HttpMethod.POST, myUrl); request.SetMessageBody(form); Response response = request.Send();
Examples
The Content-Type header sent to the server will be Content-Type: multipart/form-data; boundary=multipart-form-boundary
--multipart-form-boundary Content-Disposition: form-data; name="input1" value1 --multipart-form-boundary Content-Disposition: form-data; name="files-to-upload[]" Content-Type: multipart/mixed; boundary=multipart-file-boundary --multipart-file-boundary Content-Disposition: file; filename="image.bmp" Content-Type: image/bmp (binary image data) --multipart-file-boundary Content-Disposition: file; filename="image2.bmp" Content-Type: image/bmp (binary image data) --multipart-file-boundary-- --multipart-form-boundary--
Examples
form.getMultipartFormBoundary();
// This will return "--multipart-form-boundary"
See Also