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.WebAssembly: clrWebBrowser (in clrWebBrowser.dll) Version: 9.5.7.98 (1.0.0.0)
Syntax
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
- If the message body is a Form, then you should use the SetMessageBody(Form) 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
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