Example: web.custom_request

In the following recorded script, the user began recording from http://lazrus/html/forms/file.html. When the user submitted his request, VuGen inserted a add_header function, followed by a custom_request function.

String htmlBody;
try{
web.url("file.html",
    "URL=http://lazarus/html/forms/file.html", 
    new String[]{"TargetFrame=_TOP", "LAST"});
web.add_header("Content–Type",
	"multipart/form–data; boundary=–––––––––––––––––––––––––––292742461228954");

// Put the body in a String object to make this example more readable.
htmlBody = "Body=–––––––––––––––––––––––––––––292742461228954"
    + "\r\nContent–Disposition: form–data; "
    + "name=\"entry\"\r\n\r\nText\r\n"
    + "–––––––––––––––––––––––––––––292742461228954\r\n"
    + "Content–Disposition: f–––––––––––292742461228954––\r\n";
web.custom_request("post_query.exe", 
    "Method=POST", 
    new String[]{
        "URL=http://lazarus/cgi–bin/post_query.exe",
        htmlBody, // String object is not in quotes
        "TargetFrame=",
    "LAST"});
}
catch (Exception e) {}