Request SetMessageBodyFromFile Method C# API
Sets the body of the HTTP request that will be sent to the server, by loading data from a data file.

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

public void SetMessageBodyFromFile(
	string fileName
)

Parameters

fileName
Type: System String
The path of the filename, relative to the Virtual User's data directory.
Remarks

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

Note Note
If you are using this method in your script, make sure that the file containing the data is in the data/Files directory within your project.

Examples

The following example demonstrates setting the message body of a POST request from the contents of a file.
Url url32 = new Url(protocol1, localhost, "/uploadFile");
Request request32 = Browser.CreateRequest(HttpMethod.POST, url32, 32);
request32.SetMessageBodyFromFile("myDoc.doc");
Response response32 = request32.Send();
See Also