Request SetMessageBody Method (String, Encoding)C# API
Sets the body of the HTTP request that will be sent to the server, specifying the character encoding to use to encode the post data. This method is normally used with a POST or PUT request.

Namespace: Facilita.Web
Assembly: clrWebBrowser (in clrWebBrowser.dll) Version: 9.5.5.77 (1.0.0.0)
Syntax

public void SetMessageBody(
	string messageBody,
	Encoding encoding
)

Parameters

messageBody
Type: System String
The body of the message (e.g. the POST data).
encoding
Type: System.Text Encoding
The character encoding with which to encode the message body when it is sent as bytes.
Remarks

Examples

The following example demonstrates setting the message body of a POST request.
Url url32 = new Url(protocol1, localhost, "/login");
Request request32 = Browser.CreateRequest(HttpMethod.POST, url32, 32);
request32.SetMessageBody("Email=user@testplant.com&Password=password&RememberMe=false", Encoding.UTF8);
Response response32 = request32.Send();
See Also