Skip to content

Commit 3d04484

Browse files
committed
Added: New example for _WinHttpSimpleFormFill().
1 parent e96d6cb commit 3d04484

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#include "WinHttp.au3"
2+
3+
; Example 5:
4+
; 1. Open try.coderlearner.com form-action page (http://try.coderlearner.com/html5/form/form_formaction_ex_2.html)
5+
; 2. Fill form on that page with these values/conditins:
6+
; - form is default one
7+
; - set -User- and -Password- data to input boxes. Locate input boxes by their names -loginName- and -loginPass-
8+
; - click third button (register action)
9+
10+
; Initialize and get session handle
11+
$hOpen = _WinHttpOpen()
12+
; Get connection handle
13+
$hConnect = _WinHttpConnect($hOpen, "http://try.coderlearner.com")
14+
; Fill form on this page
15+
$aRead = _WinHttpSimpleFormFill($hConnect, "html5/form/form_formaction_ex_2.html", _
16+
Default, _
17+
"name:loginName", "User", _
18+
"name:loginPass", "Password", _
19+
"type:submit", 2 _ ; third button (zero-based counting scheme)
20+
)
21+
; Close connection handle
22+
_WinHttpCloseHandle($hConnect)
23+
; Close session handle
24+
_WinHttpCloseHandle($hOpen)
25+
26+
MsgBox(4096, "Returned", $aRead)

0 commit comments

Comments
 (0)