Request SetMessageBody Method (Form)C# API
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.Web
Assembly: clrWebBrowser (in clrWebBrowser.dll) Version: 9.4.0.26 (1.0.0.0)
Syntax

public void SetMessageBody(
	Form form
)

Parameters

form
Type: Facilita.Web Form
The body of the message (e.g. the POST data).
Remarks

This method is normally used with a POST or PUT request.
Examples

The following example demonstrates setting POST data on a Request from a Form object.
// 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