Sets the body of the HTTP request that will be sent to the server, as name/value pairs
extracted from the specified Form object.
Namespace: Facilita.WebAssembly: clrWebBrowser (in clrWebBrowser.dll) Version: 9.5.8.37 (1.0.0.0)
Syntax
Parameters
- form
- Type: Facilita.Web Form
The body of the message (e.g. the POST data).
Remarks
- If the message body consists of text, then you should use the SetMessageBody(String) overload instead.
- If the message body consists of binary data, then you should use the SetMessageBody( Byte ) overload.
- If the message body is very large, then it may be easier to store the data in a file and use the SetMessageBodyFromFile(String) method instead.
Examples
// Create a POST request Url url33 = new Url(protocol1, localhost, "/cart"); Request request33 = Browser.CreateRequest(HttpMethod.POST, url33, 33); // Create a new form and populate it with some data Form postData33 = new Form(); postData33.setCharEncoding("utf-8"); postData33.AddElement(new InputElement("itemquantity82", "1")); postData33.AddElement(new InputElement("startcheckout", "startcheckout")); // attach the form to the POST request and send it request33.SetMessageBody(postData33); Response response33 = request33.Send();
See Also