Example: web_submit_data
In the following example, the web_submit_data function submits a form using the POST method:
web_submit_data("default.aspx", "Action=http://lazarus/flightnet/default.aspx", "Method=POST", "TargetFrame=", "RecContentType=text/html", "Referer=http://lazarus/flightnet/", "Snapshot=t7.inf", "Mode=HTML", ITEMDATA, "Name=grpType", "Value=radRoundtrip", ENDITEM, "Name=lstDepartingCity", "Value=DEN", ENDITEM, "Name=lstDestinationCity", "Value=LAX", ENDITEM, "Name=txtDepartureDate", "Value=8/19/2003", ENDITEM, "Name=txtReturnDate", "Value=8/19/2003", ENDITEM, "Name=txtQuantity", "Value=1", ENDITEM, "Name=radClass", "Value=1", ENDITEM, "Name=radSeat", "Value=1", ENDITEM, "Name=btnAvailableFlights", "Value=Next >", ENDITEM, LAST );
In the following example, the web_submit_datafunction submits two files using the POST method:
web_submit_data("Attachments", "Action=http://barton.cottage@.Devonshire.uk/Attachments?YY=45434", "Method=POST", "EncType=multipart/form-data", "TargetFrame=", "RecContentType=text/html", "Referer=http:///barton.cottage@.Devonshire.uk/Compose?YY=20435", "Snapshot=t5.inf", "Mode=HTML", ITEMDATA, "Name=userFile0", "Value=E:\\sense_sensibility\\Elinor.htm", "File=yes", "ContentType=text/html", // Override default "text/plain" for .txt files FilePath=Elinor.txt", "ContentTransferEncoding=html/text", ENDITEM, "Name=userFile1", "Value=E:\\sense_sensibility\\Marianne.jpg", "File=yes", ENDITEM, LAST );